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