From e2a947a61ac108101dbe62ec7475487cd356b38e 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: Thu, 22 Feb 2024 20:45:50 +0330 Subject: [PATCH] before begaii --- components/Cards/CardCategories/page.jsx | 15 +-- .../Cards/CardCategoriesMobile/page.jsx | 15 +-- components/Cards/CardNormal/page.jsx | 26 ++-- components/Cards/CardSurprise/page.jsx | 125 ++++++++++++------ .../Cards/Components/AddToCart/page.jsx | 10 -- .../Mobile/FilterCategoryMobile/page.jsx | 43 +----- components/LandingPage/HeroSection/page.jsx | 4 +- components/LandingPage/HomeSection/page.jsx | 5 +- .../LandingPage/SurpriseSection/page.jsx | 3 +- components/Navbar/page.jsx | 24 ++-- components/TimerDown/TimerDown.jsx | 38 +++--- plugins/Goftino/page.jsx | 19 +++ plugins/bottomSheet/BottomSheetAddress.jsx | 53 +++++--- plugins/bottomSheet/BottomSheetLogOut.jsx | 2 + src/app/cart/checkout/page.jsx | 36 ++--- src/app/cart/page.jsx | 10 +- src/app/layout.jsx | 13 +- src/app/login/page.jsx | 9 +- src/app/page.jsx | 4 + src/app/products/[...id]/page.jsx | 2 +- src/app/purchase-callback/page.jsx | 6 +- style/globals.css | 19 +++ tailwind.config.js | 8 ++ 23 files changed, 285 insertions(+), 204 deletions(-) create mode 100644 plugins/Goftino/page.jsx diff --git a/components/Cards/CardCategories/page.jsx b/components/Cards/CardCategories/page.jsx index 2195837..03c99c2 100644 --- a/components/Cards/CardCategories/page.jsx +++ b/components/Cards/CardCategories/page.jsx @@ -49,16 +49,16 @@ const CardCategories = ({ data }) => { {!!data.mainImage ? ( ) : (
@@ -69,10 +69,9 @@ const CardCategories = ({ data }) => { {data.persianName}{" "}

- {data.stock <= 3 && ( -

- {" "} - {data.stock}عدد موجود انبار + {data.stock <= 3 && data.stock !== 0 && ( +

+ {data.stock} عدد موجود انبار

)} diff --git a/components/Cards/CardCategoriesMobile/page.jsx b/components/Cards/CardCategoriesMobile/page.jsx index ff85e51..c73e5b4 100644 --- a/components/Cards/CardCategoriesMobile/page.jsx +++ b/components/Cards/CardCategoriesMobile/page.jsx @@ -19,16 +19,16 @@ const CardCategoriesMobile = ({ data }) => { {!!data.mainImage ? ( ) : (
@@ -43,10 +43,9 @@ const CardCategoriesMobile = ({ data }) => { {data?.persianName}

- {data.stock <= 3 && ( -

- {" "} - {data.stock}عدد موجود انبار + {data.stock <= 3 && data.stock !== 0 && ( +

+ {data.stock} عدد موجود انبار

)}
diff --git a/components/Cards/CardNormal/page.jsx b/components/Cards/CardNormal/page.jsx index 5731fc7..95a913d 100644 --- a/components/Cards/CardNormal/page.jsx +++ b/components/Cards/CardNormal/page.jsx @@ -1,12 +1,13 @@ "use client"; -import { useContext } from "react"; +import React, { useContext } from "react"; +import { SwiperSlide } from "swiper/react"; import logo from "../../../public/images/logo.png"; -import AppContext from "@ctx/AppContext"; import Image from "next/image"; -import Link from "next/link"; import PersianNumber from "plugins/PersianNumber"; -import AddToCart from "../Components/AddToCart/page"; +import AppContext from "@ctx/AppContext"; +import AddToCart from "../Components/AddToCart/Page"; +import Link from "next/link"; const CardNormal = ({ data }) => { const CTX = useContext(AppContext); @@ -41,16 +42,16 @@ const CardNormal = ({ data }) => { {!!data.mainImage ? ( ) : ( -
+
@@ -58,13 +59,12 @@ const CardNormal = ({ data }) => {

- {data.persianName}{" "} + {data.persianName}

- {data.stock <= 3 && ( + {data.stock <= 3 && data.stock !== 0 && (

- {" "} - {data.stock}عدد موجود انبار + {data.stock} عدد موجود انبار

)}
diff --git a/components/Cards/CardSurprise/page.jsx b/components/Cards/CardSurprise/page.jsx index 679544e..c17b7c9 100644 --- a/components/Cards/CardSurprise/page.jsx +++ b/components/Cards/CardSurprise/page.jsx @@ -1,60 +1,97 @@ +"use client"; +import { useContext } from "react"; +import logo from "../../../public/images/logo.png"; + +import AppContext from "@ctx/AppContext"; import Image from "next/image"; +import Link from "next/link"; import PersianNumber from "plugins/PersianNumber"; -import p1 from "../../../public/images/product/1.png"; import AddToCart from "../Components/AddToCart/page"; -const CardSurprise = () => { +const CardSurprise = ({ data }) => { + const CTX = useContext(AppContext); + const cart = CTX.state.cart; return ( -
+ <> + {" "} <> -
handleRoutineShiftPlanWithDay(index)} - > -
-
-

- - % -

-
-
{" "} -
- -
-
-

- لوسیون بدن سلامتی | maya -

-

- {" "} - 3 عدد موجود انبار -

-
-
- -
- + +
handleRoutineShiftPlanWithDay(index)} + > + {data.hasDiscount && ( +
+
+

+ + % +

+
+
+ )} -
- {2 == 2 ? ( +
+ {!!data.mainImage ? ( + + ) : ( +
+ +
+ )} +
+
+

+ {data.persianName}{" "} +

+ + {data.stock <= 3 && data.stock !== 0 && ( +

+ {data.stock} عدد موجود انبار +

+ )} +
+
+ + +
+
+ +
+ +
+ {data?.hasDiscount ? ( <>

- +

{" "}

- +

تومان
@@ -63,14 +100,14 @@ const CardSurprise = () => {
{" "}

- +

تومان
)}
-
+ ); }; diff --git a/components/Cards/Components/AddToCart/page.jsx b/components/Cards/Components/AddToCart/page.jsx index 3f177d7..59d043b 100644 --- a/components/Cards/Components/AddToCart/page.jsx +++ b/components/Cards/Components/AddToCart/page.jsx @@ -7,16 +7,6 @@ const AddToCart = ({ data, theme }) => { const CTX = useContext(AppContext); const cart = CTX.state.cart; - console.log( - data?.id, - data?.persianName, - data?.cost, - data?.costWithDiscount, - data?.mainImage, - data?.hasDiscount, - data?.maxOrderCount - ); - const handleAddItemToCart = (id) => { CTX.AddItemToCart( data?.id, diff --git a/components/Category/Mobile/FilterCategoryMobile/page.jsx b/components/Category/Mobile/FilterCategoryMobile/page.jsx index d272589..bad0318 100644 --- a/components/Category/Mobile/FilterCategoryMobile/page.jsx +++ b/components/Category/Mobile/FilterCategoryMobile/page.jsx @@ -90,40 +90,9 @@ const FilterCategoryMobile = (props) => {
{trendFilter ? ( -
- {/*
props.setSortBy(1)} - > -

پربازدید ترین ها

-
+
props.setSortBy(2)} - > -

پربازدید ها

-
-
props.setSortBy(3)} - > -

ترین ها

-
-
props.setSortBy(4)} - > -

پربازدید ها

-
-
props.setSortBy(5)} - > -

پربازدید ترین

-
*/} - -
props.setSortBy(1)} @@ -137,7 +106,7 @@ const FilterCategoryMobile = (props) => {

props.setSortBy(2)} @@ -151,7 +120,7 @@ const FilterCategoryMobile = (props) => {

props.setSortBy(3)} @@ -165,7 +134,7 @@ const FilterCategoryMobile = (props) => {

props.setSortBy(4)} @@ -179,7 +148,7 @@ const FilterCategoryMobile = (props) => {

props.setSortBy(5)} diff --git a/components/LandingPage/HeroSection/page.jsx b/components/LandingPage/HeroSection/page.jsx index ae87d8c..7d84bed 100644 --- a/components/LandingPage/HeroSection/page.jsx +++ b/components/LandingPage/HeroSection/page.jsx @@ -12,9 +12,9 @@ const HeroSection = () => {

- وسمه ، بن ماضـــــــــــــــــی زیبایی + وسمه ، بُن مضـــــــــــارع زیبایی

-

+

پلتفرم زیبایی ایرانی راهی برای زیبایی بهتر

diff --git a/components/LandingPage/HomeSection/page.jsx b/components/LandingPage/HomeSection/page.jsx index e02336c..fbe9ba8 100644 --- a/components/LandingPage/HomeSection/page.jsx +++ b/components/LandingPage/HomeSection/page.jsx @@ -2,6 +2,7 @@ import CardNormal from "@comp/Cards/CardNormal/page"; import Image from "next/image"; import { Swiper, SwiperSlide } from "swiper/react"; import khane from "../../../public/images/khane.jpg"; +import CardSurprise from "@comp/Cards/CardSurprise/page"; const HomeSection = ({ data }) => { return ( @@ -14,7 +15,7 @@ const HomeSection = ({ data }) => {
-
+

لوازم بهداشتی منزل وسمه @@ -51,7 +52,7 @@ const HomeSection = ({ data }) => { > {data?.map((e, index) => ( - + ))} diff --git a/components/LandingPage/SurpriseSection/page.jsx b/components/LandingPage/SurpriseSection/page.jsx index 9c24af9..006edd0 100644 --- a/components/LandingPage/SurpriseSection/page.jsx +++ b/components/LandingPage/SurpriseSection/page.jsx @@ -1,4 +1,5 @@ import CardNormal from "@comp/Cards/CardNormal/page"; +import TimerDown from "@comp/TimerDown/TimerDown"; import { Swiper, SwiperSlide } from "swiper/react"; const SurpriseSection = ({ data }) => { @@ -29,7 +30,7 @@ const SurpriseSection = ({ data }) => {

پیشنهاد های ویژه امروز{" "}

- {/* */} +

{
{

handleItemNavber(index)} onMouseLeave={() => setNavItemHover(null)} @@ -347,13 +347,15 @@ const Navbar = ({ theme }) => { } `} > {" "} -

- {isScrolled ? ( - - ) : ( - - )} -
+ +
+ {isScrolled ? ( + + ) : ( + + )} +
+
{profile?.length <= 0 ? ( diff --git a/components/TimerDown/TimerDown.jsx b/components/TimerDown/TimerDown.jsx index fff93a4..00c3817 100644 --- a/components/TimerDown/TimerDown.jsx +++ b/components/TimerDown/TimerDown.jsx @@ -4,7 +4,7 @@ import PersianNumber from "plugins/PersianNumber"; import { useEffect, useState } from "react"; const TimerDown = () => { - const targetTimestamp = 1707629566 * 1000; // Convert to milliseconds + const targetTimestamp = 1710654443 * 1000; // Convert to milliseconds const [timeRemaining, setTimeRemaining] = useState({ days: 0, @@ -46,46 +46,46 @@ const TimerDown = () => { }, []); return ( -
-
-

+

+
+

- :

+ +

روز

-
-

+

+

- :

+

ساعت

- -
-

+

+

- :

+

دقیقه

- -
+
{" "} -

+

+

ثانیه

diff --git a/plugins/Goftino/page.jsx b/plugins/Goftino/page.jsx new file mode 100644 index 0000000..317ea72 --- /dev/null +++ b/plugins/Goftino/page.jsx @@ -0,0 +1,19 @@ +import Script from "next/script"; + +export default function Goftino() { + const getGoftiono = () => { + return { + __html: ` !function(){var i="Gk1Yld",a=window,d=document;function g(){var g=d.createElement("script"),s="https://www.goftino.com/widget/"+i,l=localStorage.getItem("goftino_"+i);g.async=!0,g.src=l?s+"?o="+l:s;d.getElementsByTagName("head")[0].appendChild(g);}"complete"===d.readyState?g():a.attachEvent?a.attachEvent("onload",g):a.addEventListener("load",g,!1);}(); + `, + }; + }; + + return ( + <> +