fix " - " for product and image op
parent
7fea6fe1f5
commit
dc99c1638d
|
@ -75,7 +75,7 @@ export default function CategoriesData({ params }) {
|
||||||
{!CTX.state.isMobile && (
|
{!CTX.state.isMobile && (
|
||||||
<div className="xs:hidden lg:block">
|
<div className="xs:hidden lg:block">
|
||||||
<div className="text-right px-8 py-5">
|
<div className="text-right px-8 py-5">
|
||||||
<h1 className="font-medium ">{decodedName}</h1>
|
<h1 className="font-medium ">{decodedName.replace(/-/g, " ")}</h1>
|
||||||
</div>
|
</div>
|
||||||
<div className="pl-20 pr-10 grid lg:grid-cols-8 xl:grid-cols-5 rtl mt-10 ">
|
<div className="pl-20 pr-10 grid lg:grid-cols-8 xl:grid-cols-5 rtl mt-10 ">
|
||||||
<FilterCategory
|
<FilterCategory
|
||||||
|
@ -127,7 +127,9 @@ export default function CategoriesData({ params }) {
|
||||||
isRangePrice={isRangePrice}
|
isRangePrice={isRangePrice}
|
||||||
/>
|
/>
|
||||||
<div className="text-right px-8 py-5">
|
<div className="text-right px-8 py-5">
|
||||||
<h1 className="font-medium text-sm ">{decodedName}</h1>
|
<h1 className="font-medium text-sm ">
|
||||||
|
{decodedName.replace(/-/g, " ")}
|
||||||
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{true ? (
|
{true ? (
|
||||||
|
|
|
@ -6,13 +6,15 @@ import PersianNumber from "plugins/PersianNumber";
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import logo from "../../../public/images/logo.png";
|
import logo from "../../../public/images/logo.png";
|
||||||
import AddToCart from "../Components/AddToCart/page";
|
import AddToCart from "../Components/AddToCart/page";
|
||||||
|
import hyphenateString from "plugins/HyphenateString/page";
|
||||||
|
|
||||||
const CardCart = ({ data }) => {
|
const CardCart = ({ data }) => {
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
|
const hyphenatedName = hyphenateString(data.persianName);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="group border-t-[1px] border-gray-100 w-full hover:bg-white z-40 tr03 flex rtl pt-2">
|
<div className="group border-t-[1px] border-gray-100 w-full hover:bg-white z-40 tr03 flex rtl pt-2">
|
||||||
<Link href={`/products/${data.id}/${data.persianName}`}>
|
<Link href={`/products/${data.id}/${hyphenatedName}`}>
|
||||||
<div className=" h-fit ">
|
<div className=" h-fit ">
|
||||||
{!!data.mainImage ? (
|
{!!data.mainImage ? (
|
||||||
<Image
|
<Image
|
||||||
|
@ -34,7 +36,7 @@ const CardCart = ({ data }) => {
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<div className="p-3 text-right w-full">
|
<div className="p-3 text-right w-full">
|
||||||
<Link href={`/products/${data.id}/${data.persianName}`}>
|
<Link href={`/products/${data.id}/${hyphenatedName}`}>
|
||||||
<p className="mb-0 xs:text-[12px] lg:text-[11px] xl:text-[15px] max-h-[50px] tr03 ">
|
<p className="mb-0 xs:text-[12px] lg:text-[11px] xl:text-[15px] max-h-[50px] tr03 ">
|
||||||
{data?.persianName}
|
{data?.persianName}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -7,10 +7,12 @@ import PersianNumber from "plugins/PersianNumber";
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import logo from "../../../public/images/logo.png";
|
import logo from "../../../public/images/logo.png";
|
||||||
import AddToCart from "../Components/AddToCart/page";
|
import AddToCart from "../Components/AddToCart/page";
|
||||||
|
import hyphenateString from "plugins/HyphenateString/page";
|
||||||
|
|
||||||
const CardCategories = ({ data }) => {
|
const CardCategories = ({ data }) => {
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
const cart = CTX.state.cart;
|
const cart = CTX.state.cart;
|
||||||
|
const hyphenatedName = hyphenateString(data.persianName);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="group border border-gray-50 w-full hover:bg-white z-40 tr03">
|
<div className="group border border-gray-50 w-full hover:bg-white z-40 tr03">
|
||||||
|
@ -44,7 +46,7 @@ const CardCategories = ({ data }) => {
|
||||||
</div>{" "}
|
</div>{" "}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<Link href={`/products/${data.id}/${data.persianName}`}>
|
<Link href={`/products/${data.id}/${hyphenatedName}`}>
|
||||||
<div className="w-full h-fit flex justify-center ">
|
<div className="w-full h-fit flex justify-center ">
|
||||||
{!!data.mainImage ? (
|
{!!data.mainImage ? (
|
||||||
<Image
|
<Image
|
||||||
|
|
|
@ -7,14 +7,16 @@ import PersianNumber from "plugins/PersianNumber";
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import logo from "../../../public/images/logo.png";
|
import logo from "../../../public/images/logo.png";
|
||||||
import AddToCart from "../Components/AddToCart/page";
|
import AddToCart from "../Components/AddToCart/page";
|
||||||
|
import hyphenateString from "plugins/HyphenateString/page";
|
||||||
|
|
||||||
const CardCategoriesMobile = ({ data }) => {
|
const CardCategoriesMobile = ({ data }) => {
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
const cart = CTX.state.cart;
|
const cart = CTX.state.cart;
|
||||||
|
const hyphenatedName = hyphenateString(data.persianName);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="group border-t-[1px] border-gray-200 w-full hover:bg-white z-40 tr03 flex rtl pt-2 px-3">
|
<div className="group border-t-[1px] border-gray-200 w-full hover:bg-white z-40 tr03 flex rtl pt-2 px-3">
|
||||||
<Link href={`/products/${data.id}/${data.persianName}`}>
|
<Link href={`/products/${data.id}/${hyphenatedName}`}>
|
||||||
<div className=" h-fit ">
|
<div className=" h-fit ">
|
||||||
{!!data.mainImage ? (
|
{!!data.mainImage ? (
|
||||||
<Image
|
<Image
|
||||||
|
@ -38,7 +40,7 @@ const CardCategoriesMobile = ({ data }) => {
|
||||||
|
|
||||||
<div className="p-3 text-right w-full">
|
<div className="p-3 text-right w-full">
|
||||||
{" "}
|
{" "}
|
||||||
<Link href={`/products/${data.id}/${data.persianName}`}>
|
<Link href={`/products/${data.id}/${hyphenatedName}`}>
|
||||||
<p className="mb-0 xs:text-[12px] lg:text-[11px] xl:text-[15px] max-h-[50px] tr03 ">
|
<p className="mb-0 xs:text-[12px] lg:text-[11px] xl:text-[15px] max-h-[50px] tr03 ">
|
||||||
{data?.persianName}
|
{data?.persianName}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -8,17 +8,19 @@ import PersianNumber from "plugins/PersianNumber";
|
||||||
import AppContext from "@ctx/AppContext";
|
import AppContext from "@ctx/AppContext";
|
||||||
import AddToCart from "../Components/AddToCart/page";
|
import AddToCart from "../Components/AddToCart/page";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import hyphenateString from "plugins/HyphenateString/page";
|
||||||
|
|
||||||
const CardNormal = ({ data, priority }) => {
|
const CardNormal = ({ data, priority }) => {
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
const cart = CTX.state.cart;
|
const cart = CTX.state.cart;
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
const hyphenatedName = hyphenateString(data.persianName);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
<>
|
<>
|
||||||
<Link href={`/products/${data.id}/${data.persianName}`}>
|
<Link href={`/products/${data.id}/${hyphenatedName}`}>
|
||||||
<div
|
<div
|
||||||
className={` tr03 py-2 overflow-hidden xs:h-[200px] lg:h-[230px] border border-gray-100 ${
|
className={` tr03 py-2 overflow-hidden xs:h-[200px] lg:h-[230px] border border-gray-100 ${
|
||||||
1 == 1 ? "bg-white rounded-xl" : " opacity-70"
|
1 == 1 ? "bg-white rounded-xl" : " opacity-70"
|
||||||
|
|
|
@ -7,15 +7,18 @@ import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import PersianNumber from "plugins/PersianNumber";
|
import PersianNumber from "plugins/PersianNumber";
|
||||||
import AddToCart from "../Components/AddToCart/page";
|
import AddToCart from "../Components/AddToCart/page";
|
||||||
|
import hyphenateString from "plugins/HyphenateString/page";
|
||||||
|
|
||||||
const CardSurprise = ({ data, priority }) => {
|
const CardSurprise = ({ data, priority }) => {
|
||||||
const CTX = useContext(AppContext);
|
const CTX = useContext(AppContext);
|
||||||
const cart = CTX.state.cart;
|
const cart = CTX.state.cart;
|
||||||
|
const hyphenatedName = hyphenateString(data.persianName);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
<>
|
<>
|
||||||
<Link href={`/products/${data.id}/${data.persianName}`}>
|
<Link href={`/products/${data.id}/${hyphenatedName}`}>
|
||||||
<div
|
<div
|
||||||
className={` tr03 py-2 overflow-hidden xs:h-[200px] lg:h-[230px] border border-gray-100 ${
|
className={` tr03 py-2 overflow-hidden xs:h-[200px] lg:h-[230px] border border-gray-100 ${
|
||||||
1 == 1 ? "bg-white rounded-xl" : " opacity-70"
|
1 == 1 ? "bg-white rounded-xl" : " opacity-70"
|
||||||
|
|
|
@ -30,7 +30,7 @@ const LoginStep = ({ phoneNumber, setPhoneNumber, ConfirmPhoneNumber }) => {
|
||||||
<small className="text-primary-400 text-sm font-semibold">
|
<small className="text-primary-400 text-sm font-semibold">
|
||||||
شرایط و قوانین
|
شرایط و قوانین
|
||||||
</small>{" "}
|
</small>{" "}
|
||||||
استفاده از سرویس های سایت شاواز و قوانین حریم خصوصی آن را می پذیرید.
|
استفاده از سرویس های سایت وسمه و قوانین حریم خصوصی آن را می پذیرید.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -37,7 +37,7 @@ const SignUp = ({ setLastName, setFirstName, SignUpLogin }) => {
|
||||||
<small className="text-primary-400 text-sm font-semibold">
|
<small className="text-primary-400 text-sm font-semibold">
|
||||||
شرایط و قوانین
|
شرایط و قوانین
|
||||||
</small>{" "}
|
</small>{" "}
|
||||||
استفاده از سرویس های سایت شاواز و قوانین حریم خصوصی آن را می پذیرید.
|
استفاده از سرویس های سایت وسمه و قوانین حریم خصوصی آن را می پذیرید.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -116,7 +116,9 @@ const SideBarNavBarMobile = () => {
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<Link
|
<Link
|
||||||
href={`/categories/${e.id}/${e.name}`}
|
href={`/categories/${e.id}/${e.name
|
||||||
|
.split(" ")
|
||||||
|
.join("-")}`}
|
||||||
onClick={() => CTX.setCloseNavbar(false)}
|
onClick={() => CTX.setCloseNavbar(false)}
|
||||||
>
|
>
|
||||||
<p className="mb-0 text-sm py-3 px-1 text-gray-700">
|
<p className="mb-0 text-sm py-3 px-1 text-gray-700">
|
||||||
|
@ -127,7 +129,9 @@ const SideBarNavBarMobile = () => {
|
||||||
{firstChild.map((e, index) => (
|
{firstChild.map((e, index) => (
|
||||||
<li key={index}>
|
<li key={index}>
|
||||||
<Link
|
<Link
|
||||||
href={`/categories/${e.id}/${e.name}`}
|
href={`/categories/${e.id}/${e.name
|
||||||
|
.split(" ")
|
||||||
|
.join("-")}`}
|
||||||
onClick={() => CTX.setCloseNavbar(false)}
|
onClick={() => CTX.setCloseNavbar(false)}
|
||||||
>
|
>
|
||||||
<div className="py-3 flex justify-between rtl px-1 rounded-lg my-1 text-gray-700">
|
<div className="py-3 flex justify-between rtl px-1 rounded-lg my-1 text-gray-700">
|
||||||
|
|
|
@ -259,7 +259,11 @@ const Navbar = ({ theme }) => {
|
||||||
<li className=" my-2" key={index}>
|
<li className=" my-2" key={index}>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-[10px] h-[10px] rounded-full bg-primary-500 mt-1 mx-2"></div>
|
<div className="w-[10px] h-[10px] rounded-full bg-primary-500 mt-1 mx-2"></div>
|
||||||
<Link href={`/categories/${e.id}/${e.name}`}>
|
<Link
|
||||||
|
href={`/categories/${e.id}/${e.name
|
||||||
|
.split(" ")
|
||||||
|
.join("-")}`}
|
||||||
|
>
|
||||||
<p className="mb-0 font-bold text-sm hover:text-primary-500 tr03 cursor-pointer">
|
<p className="mb-0 font-bold text-sm hover:text-primary-500 tr03 cursor-pointer">
|
||||||
{e.name}
|
{e.name}
|
||||||
</p>
|
</p>
|
||||||
|
@ -293,7 +297,9 @@ const Navbar = ({ theme }) => {
|
||||||
{e.children.map((child, index) => (
|
{e.children.map((child, index) => (
|
||||||
<Link
|
<Link
|
||||||
key={index}
|
key={index}
|
||||||
href={`/categories/${child.id}/${e.name}`}
|
href={`/categories/${child.id}/${e.name
|
||||||
|
.split(" ")
|
||||||
|
.join("-")}`}
|
||||||
>
|
>
|
||||||
<p
|
<p
|
||||||
key={child.id}
|
key={child.id}
|
||||||
|
|
|
@ -61,7 +61,7 @@ const GalleryBox = ({ file }) => {
|
||||||
<div>
|
<div>
|
||||||
{isOpenLightBox && (
|
{isOpenLightBox && (
|
||||||
<Lightbox
|
<Lightbox
|
||||||
mainSrc={`http://storage.vesmook.com/${
|
mainSrc={`http://storage.vesmeh.com/${
|
||||||
file && file[0].fileLocation
|
file && file[0].fileLocation
|
||||||
}`}
|
}`}
|
||||||
onCloseRequest={() => CTX.setIsOpenLightBox(false)}
|
onCloseRequest={() => CTX.setIsOpenLightBox(false)}
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
const hyphenateString = (str) => {
|
||||||
|
return str.split(" ").join("-");
|
||||||
|
};
|
||||||
|
export default hyphenateString;
|
|
@ -30,7 +30,7 @@ export async function generateMetadata({ params }) {
|
||||||
openGraph: {
|
openGraph: {
|
||||||
title: decodedName,
|
title: decodedName,
|
||||||
description: ` خرید ${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",
|
type: "website",
|
||||||
|
|
||||||
images: [
|
images: [
|
||||||
|
|
Loading…
Reference in New Issue