From 4f20bba0ce0ec4f29eb0ab7beb1a1ccf12398b86 Mon Sep 17 00:00:00 2001 From: Reza_ashrafi Date: Wed, 13 Jul 2022 15:01:20 +0430 Subject: [PATCH] update 9 files and delete 13 files --- public/assets/icons/bag-fill-primary.svg | 7 ++ public/assets/icons/book-fill-primary.svg | 7 ++ public/assets/icons/dark-primary.svg | 2 +- public/assets/icons/exit-primary.svg | 6 +- .../assets/icons/home-fill-primary.svg | 6 +- .../assets/icons/home-primary.svg | 4 +- public/assets/icons/packet-primary.svg | 4 +- public/assets/icons/user-fill-primary.svg | 5 + .../assets/icons/user-primary.svg | 4 +- public/assets/icons/user-white.svg | 5 + public/assets/icons/userEdit-primary.svg | 8 +- public/assets/icons/video-fill-primary.svg | 10 ++ public/assets/icons/video-primary.svg | 2 +- src/assets/images/default-profile-pic.svg | 12 -- src/components/AddToCart/index.js | 99 ---------------- src/components/Avatar/index.js | 19 ++- src/components/Banners/index.js | 60 ---------- .../bottom-products-active.svg | 14 --- .../bottom-products-deactive.svg | 9 -- .../bottom-profile-active.svg | 7 -- .../BottomNavigation/bottom-test-active.svg | 10 -- .../BottomNavigation/bottom-test-deactive.svg | 8 -- .../BottomNavigation/bottom-video-active.svg | 10 -- .../bottom-video-deactive.svg | 10 -- src/components/BottomNavigation/index.js | 112 +++++++++--------- src/router.js | 5 +- 26 files changed, 123 insertions(+), 322 deletions(-) create mode 100644 public/assets/icons/bag-fill-primary.svg create mode 100644 public/assets/icons/book-fill-primary.svg rename src/components/BottomNavigation/bottom-home-deactive.svg => public/assets/icons/home-fill-primary.svg (66%) rename src/components/BottomNavigation/bottom-home-active.svg => public/assets/icons/home-primary.svg (70%) create mode 100644 public/assets/icons/user-fill-primary.svg rename src/components/BottomNavigation/bottom-profile-deactive.svg => public/assets/icons/user-primary.svg (72%) create mode 100644 public/assets/icons/user-white.svg create mode 100644 public/assets/icons/video-fill-primary.svg delete mode 100644 src/assets/images/default-profile-pic.svg delete mode 100644 src/components/AddToCart/index.js delete mode 100644 src/components/Banners/index.js delete mode 100644 src/components/BottomNavigation/bottom-products-active.svg delete mode 100644 src/components/BottomNavigation/bottom-products-deactive.svg delete mode 100644 src/components/BottomNavigation/bottom-profile-active.svg delete mode 100644 src/components/BottomNavigation/bottom-test-active.svg delete mode 100644 src/components/BottomNavigation/bottom-test-deactive.svg delete mode 100644 src/components/BottomNavigation/bottom-video-active.svg delete mode 100644 src/components/BottomNavigation/bottom-video-deactive.svg diff --git a/public/assets/icons/bag-fill-primary.svg b/public/assets/icons/bag-fill-primary.svg new file mode 100644 index 0000000..cbc233f --- /dev/null +++ b/public/assets/icons/bag-fill-primary.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/public/assets/icons/book-fill-primary.svg b/public/assets/icons/book-fill-primary.svg new file mode 100644 index 0000000..836bfdf --- /dev/null +++ b/public/assets/icons/book-fill-primary.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/public/assets/icons/dark-primary.svg b/public/assets/icons/dark-primary.svg index b02d19f..a1cc0d8 100644 --- a/public/assets/icons/dark-primary.svg +++ b/public/assets/icons/dark-primary.svg @@ -1,4 +1,4 @@ - + diff --git a/public/assets/icons/exit-primary.svg b/public/assets/icons/exit-primary.svg index 1dd174b..21aef1a 100644 --- a/public/assets/icons/exit-primary.svg +++ b/public/assets/icons/exit-primary.svg @@ -1,6 +1,6 @@ - - - + + + diff --git a/src/components/BottomNavigation/bottom-home-deactive.svg b/public/assets/icons/home-fill-primary.svg similarity index 66% rename from src/components/BottomNavigation/bottom-home-deactive.svg rename to public/assets/icons/home-fill-primary.svg index 187e72a..1583c0e 100644 --- a/src/components/BottomNavigation/bottom-home-deactive.svg +++ b/public/assets/icons/home-fill-primary.svg @@ -1,5 +1,5 @@ - - - + + + diff --git a/src/components/BottomNavigation/bottom-home-active.svg b/public/assets/icons/home-primary.svg similarity index 70% rename from src/components/BottomNavigation/bottom-home-active.svg rename to public/assets/icons/home-primary.svg index b5aa911..5af90b9 100644 --- a/src/components/BottomNavigation/bottom-home-active.svg +++ b/public/assets/icons/home-primary.svg @@ -1,5 +1,5 @@ - - + + diff --git a/public/assets/icons/packet-primary.svg b/public/assets/icons/packet-primary.svg index 5fbdf35..6cc62bb 100644 --- a/public/assets/icons/packet-primary.svg +++ b/public/assets/icons/packet-primary.svg @@ -1,5 +1,5 @@ - - + + diff --git a/public/assets/icons/user-fill-primary.svg b/public/assets/icons/user-fill-primary.svg new file mode 100644 index 0000000..5cf607d --- /dev/null +++ b/public/assets/icons/user-fill-primary.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/BottomNavigation/bottom-profile-deactive.svg b/public/assets/icons/user-primary.svg similarity index 72% rename from src/components/BottomNavigation/bottom-profile-deactive.svg rename to public/assets/icons/user-primary.svg index 8a9ae83..333cfca 100644 --- a/src/components/BottomNavigation/bottom-profile-deactive.svg +++ b/public/assets/icons/user-primary.svg @@ -1,5 +1,5 @@ - - + + diff --git a/public/assets/icons/user-white.svg b/public/assets/icons/user-white.svg new file mode 100644 index 0000000..517e991 --- /dev/null +++ b/public/assets/icons/user-white.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/assets/icons/userEdit-primary.svg b/public/assets/icons/userEdit-primary.svg index 1be22ad..0416024 100644 --- a/public/assets/icons/userEdit-primary.svg +++ b/public/assets/icons/userEdit-primary.svg @@ -1,9 +1,9 @@ - + - - + + - + diff --git a/public/assets/icons/video-fill-primary.svg b/public/assets/icons/video-fill-primary.svg new file mode 100644 index 0000000..1d66b2b --- /dev/null +++ b/public/assets/icons/video-fill-primary.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/assets/icons/video-primary.svg b/public/assets/icons/video-primary.svg index 51c1ea6..393996e 100644 --- a/public/assets/icons/video-primary.svg +++ b/public/assets/icons/video-primary.svg @@ -1,4 +1,4 @@ - + diff --git a/src/assets/images/default-profile-pic.svg b/src/assets/images/default-profile-pic.svg deleted file mode 100644 index 49d49b6..0000000 --- a/src/assets/images/default-profile-pic.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/components/AddToCart/index.js b/src/components/AddToCart/index.js deleted file mode 100644 index fd0e007..0000000 --- a/src/components/AddToCart/index.js +++ /dev/null @@ -1,99 +0,0 @@ -import React from "react"; - -import circleTick from "../../assets/icons/vuesax-linear-tick-circle.svg"; -import shieldTick from "../../assets/icons/vuesax-linear-shield-tick.svg"; -import linearGroup from "../../assets/icons/vuesax-linear-group.svg"; - -const AddToCartCard = ({ - numberOfSuggest, - sendingTime, - button, - price, - profit, - showProduct, - productName, - productImg, - productCat, - footer, -}) => { - const specialities = [ - { - icon: circleTick, - description: `${window.t( - "توصیه به خرید توسط" - )} ${numberOfSuggest} ${window.t("نفر")}`, - }, - { - icon: linearGroup, - description: `${window.t("زمان ارسال")} ${sendingTime} ${window.t( - "روز کاری پس از سفارش" - )}`, - }, - { - icon: shieldTick, - description: window.t("گارانتی اصالت و سلامت فیزیکی"), - }, - ]; - return ( - <> -
- {showProduct && ( -
- -
-

{productName}

-

{productCat}

-
-
- )} - {specialities.map((item, index) => ( -
- {item.icon && } -

{item.description}

-
- ))} -
-

- {price} - {window.t("تومان")} -

- {profit && ( -
- {window.t("با خرید این کالا")} {profit} - {window.t("تومان سود کنید")} -
- )} -
-
{button}
-
- {footer && ( -
- {footer == "SendBack" && ( - <> - -
-

- {window.t("بازگشت بی چون و چرا")} -

-

- {window.t( - "ما خیلی خوب هستیم و دوستتون داریم در صورتی که از کالایی خوشتون نیومد میتونید بی قید و شرط بسش بدید" - )} -

-
- - )} -
- )} - - ); -}; - -export default AddToCartCard; diff --git a/src/components/Avatar/index.js b/src/components/Avatar/index.js index dbc20cc..58c5c57 100644 --- a/src/components/Avatar/index.js +++ b/src/components/Avatar/index.js @@ -1,13 +1,22 @@ import React from "react"; -import userImage from "../../assets/images/default-profile-pic.svg"; -function Avatar({ source, size, rounded, status }) { +function Avatar({ source, size = 20, status }) { return ( -
+
avatar {status && ( diff --git a/src/components/Banners/index.js b/src/components/Banners/index.js deleted file mode 100644 index 12305a9..0000000 --- a/src/components/Banners/index.js +++ /dev/null @@ -1,60 +0,0 @@ -import React from "react"; - -const Banners = ({ - mainBanner, - leftBanner, - midTopBanner, - midBottomBanner, -}) => { - return ( -
-
- - - -
-
-
- -
- - -
-
- - - -
- -
-
- - -
-
-
- ) -} - - -export default Banners; \ No newline at end of file diff --git a/src/components/BottomNavigation/bottom-products-active.svg b/src/components/BottomNavigation/bottom-products-active.svg deleted file mode 100644 index 9a4c65e..0000000 --- a/src/components/BottomNavigation/bottom-products-active.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/components/BottomNavigation/bottom-products-deactive.svg b/src/components/BottomNavigation/bottom-products-deactive.svg deleted file mode 100644 index 875ff38..0000000 --- a/src/components/BottomNavigation/bottom-products-deactive.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/components/BottomNavigation/bottom-profile-active.svg b/src/components/BottomNavigation/bottom-profile-active.svg deleted file mode 100644 index 19f103b..0000000 --- a/src/components/BottomNavigation/bottom-profile-active.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/components/BottomNavigation/bottom-test-active.svg b/src/components/BottomNavigation/bottom-test-active.svg deleted file mode 100644 index 25845a2..0000000 --- a/src/components/BottomNavigation/bottom-test-active.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/components/BottomNavigation/bottom-test-deactive.svg b/src/components/BottomNavigation/bottom-test-deactive.svg deleted file mode 100644 index f040018..0000000 --- a/src/components/BottomNavigation/bottom-test-deactive.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/components/BottomNavigation/bottom-video-active.svg b/src/components/BottomNavigation/bottom-video-active.svg deleted file mode 100644 index 6a4b5fd..0000000 --- a/src/components/BottomNavigation/bottom-video-active.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/components/BottomNavigation/bottom-video-deactive.svg b/src/components/BottomNavigation/bottom-video-deactive.svg deleted file mode 100644 index 4250b15..0000000 --- a/src/components/BottomNavigation/bottom-video-deactive.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/components/BottomNavigation/index.js b/src/components/BottomNavigation/index.js index 4595e23..36f1a96 100644 --- a/src/components/BottomNavigation/index.js +++ b/src/components/BottomNavigation/index.js @@ -2,43 +2,78 @@ import React, { useState } from "react"; import { NavLink } from "react-router-dom"; import { connect } from "react-redux"; -//assets -import deactiveHomeIcon from "./bottom-home-deactive.svg"; -import deactiveProductsIcon from "./bottom-products-deactive.svg"; -import deactiveVideoIcon from "./bottom-video-deactive.svg"; -import deactiveProfileIcon from "./bottom-profile-deactive.svg"; -import deactiveTestIcon from "./bottom-test-deactive.svg"; -import activeHomeIcon from "./bottom-home-active.svg"; -import activeTestIcon from "./bottom-test-active.svg"; -import activeProfileIcon from "./bottom-profile-active.svg"; -import activeProductsIcon from "./bottom-products-active.svg"; -import activeVideoIcon from "./bottom-video-active.svg"; - -export const BottomNavigation = ({ pages, isDark }) => { +export const BottomNavigation = ({ isDark, user }) => { const [activeLink, setActiveLink] = useState("/"); const Tab = ({ page }) => { + const isActive = activeLink === page.link; return ( setActiveLink(page.link)} + style={{ + height: 56, + }} > - + {page.name} ); }; + const pages = React.useMemo(() => { + return [ + { + id: 0, + name: window.t("صفحه اصلی"), + link: "/", + activeIcon: "/assets/icons/home-fill-primary.svg", + deactiveIcon: "/assets/icons/home-primary.svg", + }, + { + id: 1, + name: window.t("محصولات"), + link: "/products", + activeIcon: "/assets/icons/book-fill-primary.svg", + deactiveIcon: "/assets/icons/book-primary.svg", + }, + { + id: 2, + name: window.t("ویدئو"), + link: "/videos", + activeIcon: "/assets/icons/video-fill-primary.svg", + deactiveIcon: "/assets/icons/video-primary.svg", + }, + { + id: 3, + name: window.t("سبد خرید"), + link: "/cart", + activeIcon: "/assets/icons/bag-fill-primary.svg", + deactiveIcon: "/assets/icons/bag-primary.svg", + }, + { + id: 4, + name: window.t("حساب کاربری"), + link: user ? "/dashboard" : "/signup", + activeIcon: "/assets/icons/user-fill-primary.svg", + deactiveIcon: "/assets/icons/user-primary.svg", + }, + ]; + }, [user]); return ( <>