From b073cb61903f3e10be3a7127ab426bedcca06d91 Mon Sep 17 00:00:00 2001 From: Pedram Keshavarzi Date: Tue, 25 Jan 2022 12:25:28 +0330 Subject: [PATCH 1/4] Checkbox Bug Fixed --- src/components/Checkbox/index.js | 5 +- .../VerticalExpandableProductFilter/index.js | 9 +- .../Product/Desktop/ProductOverAll/index.js | 164 ++++++++++++++++++ src/views/Product/Desktop/index.js | 5 +- src/views/Product/index.js | 6 +- src/views/Products/layouts/Sidebar.js | 4 +- tailwind.config.js | 8 + 7 files changed, 193 insertions(+), 8 deletions(-) create mode 100644 src/views/Product/Desktop/ProductOverAll/index.js diff --git a/src/components/Checkbox/index.js b/src/components/Checkbox/index.js index 87ce1ae..0f1b141 100644 --- a/src/components/Checkbox/index.js +++ b/src/components/Checkbox/index.js @@ -2,6 +2,7 @@ import React from "react"; import './index.css'; export default function Checkbox(props) { + console.log(props) return (
@@ -16,8 +17,8 @@ export default function Checkbox(props) {
- -
) :
+ +
+ } ); }; @@ -182,6 +185,7 @@ export const Product = ({ const mapStateToProps = (state) => ({ book: state.book.info, grades: state.publicApi.grades, + isMobile: state.publicApi.isMobile, isDark: state.publicApi.isDark, userId: state.user.status.id, }); diff --git a/src/views/Products/layouts/Sidebar.js b/src/views/Products/layouts/Sidebar.js index d059160..8caec53 100644 --- a/src/views/Products/layouts/Sidebar.js +++ b/src/views/Products/layouts/Sidebar.js @@ -59,8 +59,8 @@ export const Sidebar = ({}) => { }, ] return
- - + +
; }; diff --git a/tailwind.config.js b/tailwind.config.js index e7fba29..0aa1760 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -49,6 +49,14 @@ module.exports = { gray70: "#707070", grayDB: "#DBDBDB", }), + // height: (theme) =>( { + // sm: '8px', + // md: '16px', + // lg: '24px', + // xl: '48px', + // h420 : '320px', + // full: '100%', + // }), borderColor: (theme) => ({ ...theme("colors"), blueC0: "#196EC0", From 381af7f5b2337c55c02d912f7623d0c818dfcef3 Mon Sep 17 00:00:00 2001 From: Pedram Keshavarzi Date: Tue, 25 Jan 2022 13:37:03 +0330 Subject: [PATCH 2/4] Product Page Product Overview Massive Changes --- src/components/Button/index.js | 8 +- .../Product/Desktop/ProductOverAll/index.js | 285 ++++++++++-------- src/views/Products/layouts/Sidebar.js | 4 +- tailwind.config.js | 3 + 4 files changed, 167 insertions(+), 133 deletions(-) diff --git a/src/components/Button/index.js b/src/components/Button/index.js index 377752f..b6df9d0 100644 --- a/src/components/Button/index.js +++ b/src/components/Button/index.js @@ -10,10 +10,14 @@ export default function Button({ onClick, selectable, active, + borderType, + twPaddings, + customStyle, + radius }) { return (
-
-
-
-
+ +
+
+

نوع کتاب

+

به من کمک کن انتخاب کنم

-
-
-

- خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ - ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ - ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ - ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ - ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ - ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ - ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ - ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن{" "} -

+
+
+
+
+

aopdjsoqweqweqweqweqweWajsduh

- ) + + + +

+ نسخه محصول را انتخاب کنید +

+ +
+
+
+
+
+
+

+ خالد حسینی تو رمان باد بادک باز مینویسه : ﻣﺮﺩ ﺁﻫﺴﺘﻪ ﺩﺭ ﮔﻮﺵ ﻓﺮﺯﻧﺪ + ﺗﺎﺯﻩ ﺑﻪ ﺑﻠﻮﻍ ﺭﺳﯿﺪﻩ ﺍﺵ ﺑﺮﺍﯼ ﭘﻨﺪ ﭼﻨﯿﻦ ﻧﺠﻮﺍ ﮐﺮﺩ : ” ﭘﺴﺮﻡ ﺩﺭ ﺯﻧﺪﮔﯽ ﻫﺮﮔﺰ + ﺩﺯﺩﯼ ﻧﮑﻦ ” ﭘﺴﺮ ﻣﺘﻌﺠﺐ ﻭ ﻣﺒﻬﻮﺕ ﺑﻪ ﭘﺪﺭ ﻧﮕﺎﻩ ﮐﺮﺩ ﺑﺪﯾﻦ ﻣﻌﻨﺎ ﮐﻪ ﺍﻭ ﻫﺮﮔﺰ + ﺩﺳﺖ ﮐﺞ ﻧﺪﺍﺷﺘﻪ ﭘﺪﺭ ﺑﻪ ﻧﮕﺎﻩ ﻣﺘﻌﺠﺐ ﻓﺮﺯﻧﺪ ﻟﺒﺨﻨﺪﯼ ﺯﺩ ﻭ ﺍﺩﺍﻣﻪ ﺩﺍﺩ : ﺩﺭ + ﺯﻧﺪﮔﯽ ﺩﺭﻭﻍ ﻧﮕﻮ ﭼﺮﺍ ﮐﻪ ﺍﮔﺮ ﮔﻔﺘﯽ ﺻﺪﺍﻗﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﯿﺎﻧﺖ ﻧﮑﻦ ﮐﻪ ﺍﮔﺮ + ﮐﺮﺩﯼ ﻋﺸﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺧﺸﻮﻧﺖ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﻣﺤﺒﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﻧﺎ ﺣﻖ + ﻧﮕﻮ ﺍﮔﺮ ﮔﻔﺘﯽ ﺣﻖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ ﺍﯼ، ﺑﯽ ﺣﯿﺎﯾﯽ ﻧﮑﻦ ﺍﮔﺮ ﮐﺮﺩﯼ ﺷﺮﺍﻓﺖ ﺭﺍ ﺩﺯﺩﯾﺪﻩ + ﺍی... ﭘﺲ ﺩﺭ ﺯﻧﺪﮔﯽ ﻓﻘﻂ ﺩﺯﺩﯼ نکن{" "} +

+
+ + ) } const mapStateToProps = (state) => ({ - book: state.book.info, - grades: state.publicApi.grades, - isDark: state.publicApi.isDark, - userId: state.user.status.id, - }); - - const mapDispatchToProps = { - getInfo: book.info, - pushToCart: userProduct.add, - setHeaderOptions: publicApi.setHeaderOptions, - }; - - export default connect(mapStateToProps, mapDispatchToProps)(ProductOverAll); - \ No newline at end of file + book: state.book.info, + grades: state.publicApi.grades, + isDark: state.publicApi.isDark, + userId: state.user.status.id, +}); + +const mapDispatchToProps = { + getInfo: book.info, + pushToCart: userProduct.add, + setHeaderOptions: publicApi.setHeaderOptions, +}; + +export default connect(mapStateToProps, mapDispatchToProps)(ProductOverAll); diff --git a/src/views/Products/layouts/Sidebar.js b/src/views/Products/layouts/Sidebar.js index 8caec53..d85e5e2 100644 --- a/src/views/Products/layouts/Sidebar.js +++ b/src/views/Products/layouts/Sidebar.js @@ -59,8 +59,8 @@ export const Sidebar = ({}) => { }, ] return
- - + +
; }; diff --git a/tailwind.config.js b/tailwind.config.js index e837da6..7682517 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -16,6 +16,7 @@ module.exports = { blueFFOP : "rgba(6, 146, 255, 0.36)", redFF: "#FFE6E6", redFF1: "#FF2020", + red19: "#C01919", yellow2: "#FDFFDA", yellow3: "#EFFF00", gray36: "#363636", @@ -45,6 +46,7 @@ module.exports = { green71: "#067182", greenBA: "#06BACE", red5F: "#5F1A05", + red19: "#C01919", yellow1: "#5F5F05", gray1: "#333333", gray70: "#707070", @@ -67,6 +69,7 @@ module.exports = { blueB9: '#86A0B9', grayDB: "#DBDBDB", gray45: "#454545", + red19: "#C01919", }), fill: (theme) => ({ From 50543dec50e84f26253c6d3029e7090369bf4e92 Mon Sep 17 00:00:00 2001 From: Pedram Keshavarzi Date: Tue, 25 Jan 2022 14:50:12 +0330 Subject: [PATCH 3/4] Side Bar Filtering Works But Has Errors (Not Loading The Data) --- src/components/Checkbox/index.js | 2 +- .../VerticalExpandableProductFilter/index.js | 6 +- .../Product/Desktop/ProductOverAll/index.js | 96 +++++++++---------- src/views/Products/index.js | 6 +- src/views/Products/layouts/Sidebar.js | 10 +- 5 files changed, 63 insertions(+), 57 deletions(-) diff --git a/src/components/Checkbox/index.js b/src/components/Checkbox/index.js index 0f1b141..42b9264 100644 --- a/src/components/Checkbox/index.js +++ b/src/components/Checkbox/index.js @@ -17,7 +17,7 @@ export default function Checkbox(props) {
- +
diff --git a/src/views/Product/Desktop/ProductOverAll/index.js b/src/views/Product/Desktop/ProductOverAll/index.js index 7c7ed3d..d17451c 100644 --- a/src/views/Product/Desktop/ProductOverAll/index.js +++ b/src/views/Product/Desktop/ProductOverAll/index.js @@ -45,55 +45,55 @@ export const ProductOverAll = ({ {"پایه" + " " + grades[book?.gradeId]}
-
- +
+ +
+
+ بیش از 160 نفر امتیاز داده اند +
-
- بیش از 160 نفر امتیاز داده اند -
-
-
-
-

نوع کتاب

-

به من کمک کن انتخاب کنم

-
-
-
-
+
+
+

نوع کتاب

+

به من کمک کن انتخاب کنم

+
+
+
+

aopdjsoqweqweqweqweqweWajsduh

@@ -117,7 +117,7 @@ export const ProductOverAll = ({

نسخه محصول را انتخاب کنید

- +
)} diff --git a/src/views/Products/layouts/Sidebar.js b/src/views/Products/layouts/Sidebar.js index d85e5e2..2ba096b 100644 --- a/src/views/Products/layouts/Sidebar.js +++ b/src/views/Products/layouts/Sidebar.js @@ -3,12 +3,12 @@ import { connect } from "react-redux"; import Checkbox from "../../../components/Checkbox"; import VerticalExpandableProductFilter from "../../../components/VerticalExpandableProductFilter"; -export const Sidebar = ({}) => { +export const Sidebar = ({onChange}) => { const filteronGrade = [ { id:0, - name: "پایه اول", + name: "اول", expaneded: false, subList: [{ id:1, @@ -17,7 +17,7 @@ export const Sidebar = ({}) => { }, { id:1, - name: "پایه دوم", + name: "دوم", expaneded: false, subList: [{ id:1, @@ -26,7 +26,7 @@ export const Sidebar = ({}) => { }, { id:2, - name: "پایه سوم", + name: "سوم", expaneded: false, subList: [], }, @@ -59,7 +59,7 @@ export const Sidebar = ({}) => { }, ] return
- +
; From 9729e99d5e9ff30bbe598abd916e69cae2b92e5f Mon Sep 17 00:00:00 2001 From: Pedram Keshavarzi Date: Tue, 25 Jan 2022 16:11:51 +0330 Subject: [PATCH 4/4] Add to Cart Card Made --- src/assets/icons/vuesax-linear-group.svg | 15 ++++ .../icons/vuesax-linear-shield-tick.svg | 9 +++ .../icons/vuesax-linear-tick-circle.svg | 9 +++ src/components/AddToCart/index.js | 51 +++++++++++++ src/components/Checkbox/index.js | 2 +- .../VerticalExpandableProductFilter/index.js | 4 +- .../Product/Desktop/ProductOverAll/index.js | 75 ++++++++++++------- tailwind.config.js | 1 + 8 files changed, 134 insertions(+), 32 deletions(-) create mode 100644 src/assets/icons/vuesax-linear-group.svg create mode 100644 src/assets/icons/vuesax-linear-shield-tick.svg create mode 100644 src/assets/icons/vuesax-linear-tick-circle.svg create mode 100644 src/components/AddToCart/index.js diff --git a/src/assets/icons/vuesax-linear-group.svg b/src/assets/icons/vuesax-linear-group.svg new file mode 100644 index 0000000..efee704 --- /dev/null +++ b/src/assets/icons/vuesax-linear-group.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/assets/icons/vuesax-linear-shield-tick.svg b/src/assets/icons/vuesax-linear-shield-tick.svg new file mode 100644 index 0000000..f897d79 --- /dev/null +++ b/src/assets/icons/vuesax-linear-shield-tick.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/icons/vuesax-linear-tick-circle.svg b/src/assets/icons/vuesax-linear-tick-circle.svg new file mode 100644 index 0000000..2f17e2a --- /dev/null +++ b/src/assets/icons/vuesax-linear-tick-circle.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/components/AddToCart/index.js b/src/components/AddToCart/index.js new file mode 100644 index 0000000..14c83bf --- /dev/null +++ b/src/components/AddToCart/index.js @@ -0,0 +1,51 @@ +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 +}) =>{ + const specialities = [ + { + icon: circleTick, + description: ` توصیه به خرید توسط ${numberOfSuggest} نفر`, + }, + { + icon: linearGroup, + description: `زمان ارسال ${sendingTime} روز کاری پس از سفارش`, + }, + { + icon: shieldTick, + description: `گارانتی اصالت و سلامت فیزیکی`, + } + ]; + return( +
+ {specialities.map((item, index) => ( +
+ {item.icon && } +

{item.description}

+
+ ))} +
+

+ {price} + تومان

+ { profit &&
با خرید این کالا {profit} تومان سود کنید
} +
+
+ {button} +
+
+ ); +}; + +export default AddToCartCard; \ No newline at end of file diff --git a/src/components/Checkbox/index.js b/src/components/Checkbox/index.js index 42b9264..38d5dd1 100644 --- a/src/components/Checkbox/index.js +++ b/src/components/Checkbox/index.js @@ -17,7 +17,7 @@ export default function Checkbox(props) {
- +
+
+
-

aopdjsoqweqweqweqweqweWajsduh

+ + proxy.status() + ? pushToCart({ + productId: + type === "digital" + ? book?.product[0]?.id + : book?.product[1]?.id, + userId: userId, + count: 1, + }) + : toast.info("ابتدا وارد حساب کاربری خود شوید.") + } + title='افزودن به سبد خرید' + backgroundColor="bg-blueC0" + border={{ color: "#196EC055", width: "1px" }} + width="100%" + color="text-white" + twPaddings='py-4' + /> + } + + />
@@ -119,34 +163,7 @@ export const ProductOverAll = ({
-