From dc99c1638dbe957c1807a1a0d606e8ebf9ea9f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=AD=D8=B3=DB=8C=D9=86=20=D9=85=D8=B9=D8=B5=D9=88=D9=85?= =?UTF-8?q?=DB=8C=20=D9=BE=D9=88=D8=B1?= Date: Fri, 12 Apr 2024 19:00:01 +0330 Subject: [PATCH] fix " - " for product and image op --- components/AppsComponent/CategoriesData/page.jsx | 6 ++++-- components/Cards/CardCart/page.jsx | 6 ++++-- components/Cards/CardCategories/page.jsx | 4 +++- components/Cards/CardCategoriesMobile/page.jsx | 6 ++++-- components/Cards/CardNormal/page.jsx | 4 +++- components/Cards/CardSurprise/page.jsx | 5 ++++- components/Login/LoginStep.jsx | 2 +- components/Login/SignUp.jsx | 2 +- components/Navbar/SideBarNavBarMobile/page.jsx | 8 ++++++-- components/Navbar/page.jsx | 10 ++++++++-- plugins/Gallery/page.jsx | 2 +- plugins/HyphenateString/page.jsx | 4 ++++ src/app/products/[...id]/page.jsx | 2 +- 13 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 plugins/HyphenateString/page.jsx diff --git a/components/AppsComponent/CategoriesData/page.jsx b/components/AppsComponent/CategoriesData/page.jsx index 32fed5a..7fe305f 100644 --- a/components/AppsComponent/CategoriesData/page.jsx +++ b/components/AppsComponent/CategoriesData/page.jsx @@ -75,7 +75,7 @@ export default function CategoriesData({ params }) { {!CTX.state.isMobile && (
-

{decodedName}

+

{decodedName.replace(/-/g, " ")}

-

{decodedName}

+

+ {decodedName.replace(/-/g, " ")} +

{true ? ( diff --git a/components/Cards/CardCart/page.jsx b/components/Cards/CardCart/page.jsx index 755045c..5d8d01d 100644 --- a/components/Cards/CardCart/page.jsx +++ b/components/Cards/CardCart/page.jsx @@ -6,13 +6,15 @@ import PersianNumber from "plugins/PersianNumber"; import { useContext } from "react"; import logo from "../../../public/images/logo.png"; import AddToCart from "../Components/AddToCart/page"; +import hyphenateString from "plugins/HyphenateString/page"; const CardCart = ({ data }) => { const CTX = useContext(AppContext); + const hyphenatedName = hyphenateString(data.persianName); return (
- +
{!!data.mainImage ? ( {
- +

{data?.persianName}

diff --git a/components/Cards/CardCategories/page.jsx b/components/Cards/CardCategories/page.jsx index d9aa91e..70fa6db 100644 --- a/components/Cards/CardCategories/page.jsx +++ b/components/Cards/CardCategories/page.jsx @@ -7,10 +7,12 @@ import PersianNumber from "plugins/PersianNumber"; import { useContext } from "react"; import logo from "../../../public/images/logo.png"; import AddToCart from "../Components/AddToCart/page"; +import hyphenateString from "plugins/HyphenateString/page"; const CardCategories = ({ data }) => { const CTX = useContext(AppContext); const cart = CTX.state.cart; + const hyphenatedName = hyphenateString(data.persianName); return (
@@ -44,7 +46,7 @@ const CardCategories = ({ data }) => {
{" "}
)} - +
{!!data.mainImage ? ( { const CTX = useContext(AppContext); const cart = CTX.state.cart; + const hyphenatedName = hyphenateString(data.persianName); return (
- +
{!!data.mainImage ? ( {
{" "} - +

{data?.persianName}

diff --git a/components/Cards/CardNormal/page.jsx b/components/Cards/CardNormal/page.jsx index cce89f2..3f77b66 100644 --- a/components/Cards/CardNormal/page.jsx +++ b/components/Cards/CardNormal/page.jsx @@ -8,17 +8,19 @@ import PersianNumber from "plugins/PersianNumber"; import AppContext from "@ctx/AppContext"; import AddToCart from "../Components/AddToCart/page"; import Link from "next/link"; +import hyphenateString from "plugins/HyphenateString/page"; const CardNormal = ({ data, priority }) => { const CTX = useContext(AppContext); const cart = CTX.state.cart; console.log(data); + const hyphenatedName = hyphenateString(data.persianName); return ( <> {" "} <> - +
{ const CTX = useContext(AppContext); const cart = CTX.state.cart; + const hyphenatedName = hyphenateString(data.persianName); + return ( <> {" "} <> - +
{ شرایط و قوانین {" "} - استفاده از سرویس های سایت شاواز و قوانین حریم خصوصی آن را می پذیرید. + استفاده از سرویس های سایت وسمه و قوانین حریم خصوصی آن را می پذیرید.

diff --git a/components/Login/SignUp.jsx b/components/Login/SignUp.jsx index 67c4b9f..b6ecb28 100644 --- a/components/Login/SignUp.jsx +++ b/components/Login/SignUp.jsx @@ -37,7 +37,7 @@ const SignUp = ({ setLastName, setFirstName, SignUpLogin }) => { شرایط و قوانین {" "} - استفاده از سرویس های سایت شاواز و قوانین حریم خصوصی آن را می پذیرید. + استفاده از سرویس های سایت وسمه و قوانین حریم خصوصی آن را می پذیرید.

diff --git a/components/Navbar/SideBarNavBarMobile/page.jsx b/components/Navbar/SideBarNavBarMobile/page.jsx index 6d21cd6..f0597c5 100644 --- a/components/Navbar/SideBarNavBarMobile/page.jsx +++ b/components/Navbar/SideBarNavBarMobile/page.jsx @@ -116,7 +116,9 @@ const SideBarNavBarMobile = () => {
  • CTX.setCloseNavbar(false)} >

    @@ -127,7 +129,9 @@ const SideBarNavBarMobile = () => { {firstChild.map((e, index) => (

  • CTX.setCloseNavbar(false)} >
    diff --git a/components/Navbar/page.jsx b/components/Navbar/page.jsx index e701f90..70b03fc 100644 --- a/components/Navbar/page.jsx +++ b/components/Navbar/page.jsx @@ -259,7 +259,11 @@ const Navbar = ({ theme }) => {
  • - +

    {e.name}

    @@ -293,7 +297,9 @@ const Navbar = ({ theme }) => { {e.children.map((child, index) => (

    {

    {isOpenLightBox && ( CTX.setIsOpenLightBox(false)} diff --git a/plugins/HyphenateString/page.jsx b/plugins/HyphenateString/page.jsx new file mode 100644 index 0000000..1f7a6fc --- /dev/null +++ b/plugins/HyphenateString/page.jsx @@ -0,0 +1,4 @@ +const hyphenateString = (str) => { + return str.split(" ").join("-"); +}; +export default hyphenateString; diff --git a/src/app/products/[...id]/page.jsx b/src/app/products/[...id]/page.jsx index 08cd505..91fe2c8 100644 --- a/src/app/products/[...id]/page.jsx +++ b/src/app/products/[...id]/page.jsx @@ -30,7 +30,7 @@ export async function generateMetadata({ params }) { openGraph: { title: decodedName, description: ` خرید ${decodedName}| برندهای متنوع با پایین ترین قیمت | فروشگاه اینترنتی وسمه`, - url: `https://www.vesmeh.com/categories/${params.id[0]}/${decodedName}`, + // url: `https://www.vesmeh.com/categories/${params.id[0]}/${decodedName}`, type: "website", images: [