diff --git a/src/views/About/index.scss b/src/views/About/index.scss index 9c0baaa..b895647 100644 --- a/src/views/About/index.scss +++ b/src/views/About/index.scss @@ -5,6 +5,7 @@ padding: 0px 10px; direction: rtl; min-height: calc(100vh - 288px); + padding-top: 100px; &__fury { margin-top: 30px; width: 100%; diff --git a/src/views/Cart/DeliveryMethod/index.js b/src/views/Cart/DeliveryMethod/index.js new file mode 100644 index 0000000..7abd8e0 --- /dev/null +++ b/src/views/Cart/DeliveryMethod/index.js @@ -0,0 +1,79 @@ + +import './index.scss'; + +const maxDesktopSize = 1250; +const maxMobileSize = 550; + +const fontSize = { + desktop: { + h1: window.innerWidth > maxDesktopSize ? 30 : window.innerWidth / 40, + th: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 80, + h2: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 55, + h3: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, + strong: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, + span: window.innerWidth > maxDesktopSize ? 10 : window.innerWidth / 95, + }, + mobile: { + h1: window.innerWidth > maxMobileSize ? 20 : window.innerWidth / 13, + h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 24, + h3: window.innerWidth > maxMobileSize ? 12 : window.innerWidth / 30, + strong: window.innerWidth > maxMobileSize ? 12 : window.innerWidth / 30, + span: window.innerWidth > maxMobileSize ? 10 : window.innerWidth / 34, + p: window.innerWidth > maxMobileSize ? 12 : window.innerWidth / 32, + input: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 20, + }, +}; +const DeliveryMethod = (props) => { + return ( + <> + {window.innerWidth > 1000 ? ( +
+ props.parent.setState({ selectedDelivery: props.data }) + } + > + + {props.data.name} + +
+

+ {props.data.price} +

+ تومان +
+
+ ) : null} + {window.innerWidth < 1000 ? ( +
+ props.parent.setState({ selectedDelivery: props.data }) + } + > + + {props.data.name} + +
+

{props.data.price}

+ تومان +
+
+ ) : null} + + ); +}; + +export default DeliveryMethod; \ No newline at end of file diff --git a/src/views/Cart/DeliveryMethod/index.scss b/src/views/Cart/DeliveryMethod/index.scss new file mode 100644 index 0000000..9037434 --- /dev/null +++ b/src/views/Cart/DeliveryMethod/index.scss @@ -0,0 +1,48 @@ +.mobile-delivery-methods { + padding: 6px; + border-radius: 10px; + border: 1px solid #88a9ff; + margin-top: 10px; + width: 48%; + h3, + strong, + span { + font-family: numeralLight; + font-weight: 100; + margin: 0px; + } + strong { + // width: 50%; + color: #678ef8; + letter-spacing: -1px; + } + h3, + span { + color: #02a255; + font-family: numeralMedium; + } +} + +.delivery-methods { + padding: 6px; + border-radius: 10px; + border: 1px solid #88a9ff; + margin-top: 10px; + h3, + strong, + span { + font-family: numeralLight; + font-weight: 100; + margin: 0px; + } + strong { + width: 50%; + color: #678ef8; + letter-spacing: -1px; + } + h3, + span { + color: #02a255; + font-family: numeralMedium; + } +} \ No newline at end of file diff --git a/src/views/Cart/Discount/index.js b/src/views/Cart/Discount/index.js new file mode 100644 index 0000000..0a214e4 --- /dev/null +++ b/src/views/Cart/Discount/index.js @@ -0,0 +1,57 @@ +import React from 'react'; +import './index.scss'; + +const maxDesktopSize = 1250; +const maxMobileSize = 550; + +const fontSize = { + desktop: { + h2: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 55, + input : window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 75, + button : window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 75, + p: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, + }, + mobile: { + h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 24, + p: window.innerWidth > maxMobileSize ? 12 : window.innerWidth / 32, + input: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 20, + button: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 20, + + }, +}; + + +const DiscoutCode = (props) => { + return ( + <> + {window.innerWidth > 1000 ? ( +
+

کد تخفیف

+

+ اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید و دکمه ثبت کد را + بزنید +

+
+ + +
+
+ ) : null} + {window.innerWidth < 1000 ? ( +
+

کد تخفیف

+

+ اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید و دکمه ثبت کد را + بزنید +

+
+ + +
+
+ ) : null} + + ); +}; + +export default DiscoutCode; \ No newline at end of file diff --git a/src/views/Cart/Discount/index.scss b/src/views/Cart/Discount/index.scss new file mode 100644 index 0000000..7627804 --- /dev/null +++ b/src/views/Cart/Discount/index.scss @@ -0,0 +1,83 @@ +.discount-code { + border-bottom: 1px dotted #A5A5A5; + margin-top: 20px; + padding-bottom: 20px; + h2 { + font-family: numeralBold; + color: #2580ec; + } + p { + font-family: numeralLight; + color: #a5a5a5; + letter-spacing: -1px; + } + &__box{ + border: 1px solid #2b95ff; + padding: 5px; + border-radius: 10px; + input { + color: #2b95ff; + font-family: numeralLight; + text-align: center; + padding: 0px; + border-radius: 10px; + border: 0px; + flex: 1; + direction: ltr; + &:focus{ + outline : none; + } + } + button { + border-radius: 10px; + background-color: #2b95ff; + font-family: numeralLight; + color: white; + padding: 5px 10px; + border: 0px; + width: 80px; + } + } +} + +.mobile-discount-code { + border-bottom: 1px dotted #A5A5A5; + margin-top: 20px; + padding-bottom: 20px; + h2 { + font-family: numeralBold; + color: #2580ec; + } + p { + font-family: numeralLight; + color: #a5a5a5; + letter-spacing: -1px; + } + &__box{ + border: 1px solid #2b95ff; + padding: 5px; + border-radius: 10px; + input { + color: #2b95ff; + font-family: numeralLight; + text-align: center; + padding: 5px; + border-radius: 10px; + border: 0px; + flex: 1; + direction: ltr; + &:focus{ + outline : none; + } + } + button { + border-radius: 10px; + background-color: #2b95ff; + font-family: numeralLight; + color: white; + padding: 10px 20px; + border: 0px; + } + } + +} \ No newline at end of file diff --git a/src/views/Cart/Factor/index.js b/src/views/Cart/Factor/index.js new file mode 100644 index 0000000..9a1243b --- /dev/null +++ b/src/views/Cart/Factor/index.js @@ -0,0 +1,75 @@ +import React, { Component } from 'react'; +import './index.scss'; + +const maxDesktopSize = 1250; +const maxMobileSize = 550; + +const fontSize = { + desktop: { + h1: window.innerWidth > maxDesktopSize ? 30 : window.innerWidth / 40, + th: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 80, + h2: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 55, + h3: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, + strong: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, + span: window.innerWidth > maxDesktopSize ? 10 : window.innerWidth / 95, + }, + mobile: { + h1: window.innerWidth > maxMobileSize ? 20 : window.innerWidth / 13, + h2: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 24, + h3: window.innerWidth > maxMobileSize ? 12 : window.innerWidth / 30, + strong: window.innerWidth > maxMobileSize ? 12 : window.innerWidth / 30, + span: window.innerWidth > maxMobileSize ? 10 : window.innerWidth / 34, + p: window.innerWidth > maxMobileSize ? 12 : window.innerWidth / 32, + input: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 20, + }, +}; + +const Factor = (props) => { + const { list, parent } = props; + + const totalPrice = () => { + let total = 0; + for (let i = 0; i < parent.state.list.length; i++) { + total += parent.state.list[i].price * parent.state.list[i].number; + } + return total; + }; + return ( + <> + {window.innerWidth < 1000 ? ( +
+
+ مبلغ سبد خرید + {totalPrice()} تومان +
+
+ هزینه ارسال + {props.parent.state.selectedDelivery.price} تومان +
+
+ میزان تخفیف + {props.parent.state.discount} تومان +
+
+ ) : null} + {window.innerWidth > 1000 ? ( +
+
+ مبلغ سبد خرید + {totalPrice()} تومان +
+
+ هزینه ارسال + {props.parent.state.selectedDelivery.price} تومان +
+
+ میزان تخفیف + {props.parent.state.discount} تومان +
+
+ ) : null} + + ); +}; + +export default Factor; \ No newline at end of file diff --git a/src/views/Cart/Factor/index.scss b/src/views/Cart/Factor/index.scss new file mode 100644 index 0000000..9cc7a5d --- /dev/null +++ b/src/views/Cart/Factor/index.scss @@ -0,0 +1,53 @@ +.mobile-factor{ + border-bottom: 1px dotted #A5A5A5; + margin-top: 20px; + padding-bottom: 20px; + h2 { + font-family: numeralBold; + color: #2580ec; + } + p { + font-family: numeralLight; + color: #a5a5a5; + letter-spacing: -1px; + } + div{ + margin-bottom: 10px; + strong{ + font-family: numeralLight; + color: #373737; + font-weight: 300; + } + span{ + font-family: numeralLight; + color: #373737; + } + } +} + +.factor{ + border-bottom: 1px dotted #A5A5A5; + margin-top: 20px; + padding-bottom: 20px; + h2 { + font-family: numeralBold; + color: #2580ec; + } + p { + font-family: numeralLight; + color: #a5a5a5; + letter-spacing: -1px; + } + div{ + margin-bottom: 10px; + strong{ + font-family: numeralLight; + color: #373737; + font-weight: 300; + } + span{ + font-family: numeralLight; + color: #373737; + } + } +} \ No newline at end of file diff --git a/src/views/Cart/Item/index.js b/src/views/Cart/Item/index.js deleted file mode 100644 index 24323e8..0000000 --- a/src/views/Cart/Item/index.js +++ /dev/null @@ -1,87 +0,0 @@ -import React from "react"; -import DeleteOutlineOutlinedIcon from "@material-ui/icons/DeleteOutlineOutlined"; - -import "./index.scss"; - -const maxDesktopSize = 1250; - -const fontSize = { - desktop: { - info: { - strong: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 75, - p: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 95, - span: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 95, - }, - price: { - strong: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 60, - span: window.innerWidth > maxDesktopSize ? 13 : window.innerWidth / 95, - }, - counter: { - button: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 65, - span: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 65, - }, - delete: { - span: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 75, - }, - }, -}; - -export default function Item(props) { - const { data, handleCounter, handleDelete } = props; - return ( - - - {data.title} -
- - {data.title} - -

{data.subTitle}

- - {data.options}بسته الحاقی: - -
- - - - {data.price} تومان - - - {data.slicePrice} قیمت هر واحد - - - -
- - - {data.number} - - -
- - - handleDelete(data.id)} - /> - handleDelete(data.id)} - style={{ fontSize: fontSize.desktop.delete.span }} - > - حذف - - - - - ); -} diff --git a/src/views/Cart/Item/index.scss b/src/views/Cart/Item/index.scss deleted file mode 100644 index b161ec3..0000000 --- a/src/views/Cart/Item/index.scss +++ /dev/null @@ -1,71 +0,0 @@ -.cart-item{ - // justify-content: space-between; - border-top: 1px solid #eee; - padding: 15px 0px; - &__info{ - flex: 3; - // flex-shrink: 1; - img{ - height: 100px; - border-radius: 10px; - margin-left: 10px; - } - div{ - strong{ - font-family: numeralBold; - color: #373737; - } - p{ - font-family: numeralLight; - color: #00CC69; - margin: 0px; - letter-spacing: -1px; - } - span{ - font-family: numeralLight; - color: #2580EC; - letter-spacing: -1px; - } - } - } - &__price{ - flex: 1.5; - flex-shrink: 1; - color: #4D4D4F; - strong{ - font-family: numeralBold; - } - span{ - font-family: numeralLight; - } - } - &__counter{ - flex: 1.5; - flex-shrink: 1; - justify-content: center; - &--box{ - padding: 5px 10px; - border: 1px solid rgb(177, 177, 177); - border-radius: 8px; - button{ - border: 0px; - background-color: white; - color: #4D4D4F; - } - span{ - margin: 0px 15px; - color: #4D4D4F; - - } - } - - } - &__delete{ - flex: 1; - margin-left: 20px; - span{ - font-family: numeralLight; - color : #FC120A; - } - } -} \ No newline at end of file diff --git a/src/views/Cart/Table/index.js b/src/views/Cart/Table/index.js index d678795..e0086c5 100644 --- a/src/views/Cart/Table/index.js +++ b/src/views/Cart/Table/index.js @@ -1,21 +1,21 @@ -import React from 'react'; -import { makeStyles } from '@material-ui/core/styles'; -import Table from '@material-ui/core/Table'; -import TableBody from '@material-ui/core/TableBody'; -import TableCell from '@material-ui/core/TableCell'; -import TableContainer from '@material-ui/core/TableContainer'; -import TableHead from '@material-ui/core/TableHead'; -import TableRow from '@material-ui/core/TableRow'; -import Paper from '@material-ui/core/Paper'; +import React from "react"; +import { makeStyles } from "@material-ui/core/styles"; +import Table from "@material-ui/core/Table"; +import TableBody from "@material-ui/core/TableBody"; +import TableCell from "@material-ui/core/TableCell"; +import TableContainer from "@material-ui/core/TableContainer"; +import TableHead from "@material-ui/core/TableHead"; +import TableRow from "@material-ui/core/TableRow"; +import Paper from "@material-ui/core/Paper"; import DeleteOutlineOutlinedIcon from "@material-ui/icons/DeleteOutlineOutlined"; -import './index.scss'; +import "./index.scss"; const useStyles = makeStyles({ - table: { - }, + table: {}, }); const maxMobileSize = 550; +const maxDesktopSize = 1250; const fontSize = { mobile: { @@ -36,16 +36,32 @@ const fontSize = { span: window.innerWidth > maxMobileSize ? 13 : window.innerWidth / 28, }, }, + desktop: { + info: { + strong: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 75, + p: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 95, + span: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 95, + }, + price: { + strong: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 60, + span: window.innerWidth > maxDesktopSize ? 13 : window.innerWidth / 95, + }, + counter: { + button: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 65, + span: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 65, + }, + delete: { + span: window.innerWidth > maxDesktopSize ? 15 : window.innerWidth / 75, + }, + }, }; - - export default function BasicTable(props) { const classes = useStyles(); - const {list, handleCounter, handleDelete} = props; + const { list, handleCounter, handleDelete } = props; const sum = () => { let total = 0; - for(let i = 0; i < list.length; i++) { + for (let i = 0; i < list.length; i++) { total += list[i].number; } return total; @@ -53,42 +69,83 @@ export default function BasicTable(props) { const totalPrice = () => { let total = 0; - for(let i = 0; i < list.length; i++) { + for (let i = 0; i < list.length; i++) { total += list[i].price * list[i].number; } return total; - } + }; return ( <> - { - window.innerWidth < 1000 ? + {window.innerWidth < 1000 ? ( + + + + + محصولات + قیمت + + + + {list.map((row, i) => ( + + ))} + + + {sum()} محصول + + + مبلغ کل {totalPrice()} + + + +
+
+ ) : null} + {window.innerWidth > 1000 ? ( محصولات قیمت + تعداد + - { list.map((row,i) => ( - + {list.map((row, i) => ( + ))} - {sum()} محصول + - مبلغ کل {totalPrice()} + مبلغ کل {totalPrice()} + + + {sum()} محصول + + +
-
: null - } + + ) : null} - ); } @@ -102,66 +159,146 @@ export default function BasicTable(props) { // price: 2500000, const Item = (props) => { - const {data, handleCounter, handleDelete} = props; - return( - - -
- - {data.title} -
- - {data.title} - -

{data.subTitle}

- - {data.options} - -
+ const { data, handleCounter, handleDelete } = props; + return ( + <> + {window.innerWidth < 1000 ? ( + + +
+ {data.title} +
+ + {data.title} + +

+ {data.subTitle} +

+ + {data.options} + +
+ handleDelete(data.id)} + /> + handleDelete(data.id)} + style={{ + fontSize: fontSize.mobile.delete.span, + color: "#FC120A", + }} + > + حذف + +
+
+
+
+ +
+
+ + {data.price} + + + {data.slicePrice} قیمت هر واحد + +
+
+ + + {data.number} + + +
+
+
+
+ ) : null} + {window.innerWidth > 1000 ? ( + + +
+ {data.title} +
+ + {data.title} + +

+ {data.subTitle} +

+ + {data.options}بسته الحاقی: + +
+
+
+ +
+ + {data.price} تومان + + + {data.slicePrice} قیمت هر واحد + +
+
+ +
+
+ + + {data.number} + + +
+
+
+ +
handleDelete(data.id)} /> handleDelete(data.id)} - style={{ fontSize: fontSize.mobile.delete.span, color: "#FC120A"}} + style={{ fontSize: fontSize.desktop.delete.span }} > حذف - -
-
-
- - -
-
- - {data.price} - - - {data.slicePrice} قیمت هر واحد -
-
- - - {data.number} - - -
-
- -
- +
+
+
+ ) : null} + ); -} \ No newline at end of file +}; diff --git a/src/views/Cart/Table/index.scss b/src/views/Cart/Table/index.scss index e882e99..25409cc 100644 --- a/src/views/Cart/Table/index.scss +++ b/src/views/Cart/Table/index.scss @@ -74,3 +74,69 @@ .MuiTableCell-root{ padding: 10px 0px !important; } + +.cart-item{ + // justify-content: space-between; + border-top: 1px solid #eee; + padding: 15px 0px; + &__info{ + // flex-shrink: 1; + img{ + height: 100px; + border-radius: 10px; + margin-left: 10px; + } + div{ + strong{ + font-family: numeralBold; + color: #373737; + } + p{ + font-family: numeralLight; + color: #00CC69; + margin: 0px; + letter-spacing: -1px; + } + span{ + font-family: numeralLight; + color: #2580EC; + letter-spacing: -1px; + } + } + } + &__price{ + color: #4D4D4F; + strong{ + font-family: numeralBold; + } + span{ + font-family: numeralLight; + } + } + &__counter{ + justify-content: center; + &--box{ + padding: 5px 10px; + border: 1px solid rgb(177, 177, 177); + border-radius: 8px; + button{ + border: 0px; + background-color: white; + color: #4D4D4F; + } + span{ + margin: 0px 15px; + color: #4D4D4F; + + } + } + + } + &__delete{ + margin-left: 20px; + span{ + font-family: numeralLight; + color : #FC120A; + } + } +} \ No newline at end of file diff --git a/src/views/Cart/index.js b/src/views/Cart/index.js index 056bbf0..8889605 100644 --- a/src/views/Cart/index.js +++ b/src/views/Cart/index.js @@ -1,8 +1,10 @@ import React, { Component } from "react"; import Navbar from "../Home/Navbar/index"; import Footer from "../Home/Footer/index"; -import Item from "./Item/index"; import Table from "./Table/index"; +import DiscoutCode from "./Discount/index"; +import DeliveryMethod from "./DeliveryMethod/index"; +import Factor from "./Factor/index"; import book1 from "../../assets/images/book1.png"; @@ -19,6 +21,7 @@ const fontSize = { h3: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, strong: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, span: window.innerWidth > maxDesktopSize ? 10 : window.innerWidth / 95, + p: window.innerWidth > maxMobileSize ? 13 : window.innerWidth / 90, }, mobile: { h1: window.innerWidth > maxMobileSize ? 20 : window.innerWidth / 13, @@ -32,7 +35,7 @@ const fontSize = { }; export default class Cart extends Component { state = { - selectedDelivery: { name : '', price : 0}, + selectedDelivery: { name: "", price: 0 }, discount: 0, totalPrice: null, list: [ @@ -107,33 +110,16 @@ export default class Cart extends Component { <>
-
+

سبد خرید

- - - -
-
- - - - - - - - {this.state.list.map((item, i) => ( - - ))} - -
1234
+ {this.state.totalPrice ? (
جمع کل سبد خرید
@@ -154,7 +140,37 @@ export default class Cart extends Component { ))}
- + + +
+

+ جمع کل +
+ سبد خرید +

+
+ + {this.totalPrice()} + + + تومان + +
+
+
+

+ روشهای ارسال +

+

+ با توجه به شرایط یکی از دو گزینه زیر را انتخاب کنید +

+
+ {this.props.payMethods.map((item, i) => ( + + ))} +
+
+ @@ -184,7 +200,7 @@ export default class Cart extends Component { ))} - +

@@ -219,140 +235,6 @@ export default class Cart extends Component { } } -const DeliveryMethod = (props) => { - return ( - <> - {window.innerWidth > 1000 ? ( -
- props.parent.setState({ selectedDelivery: props.data }) - } - > - - {props.data.name} - -
-

- {props.data.price} -

- تومان -
-
- ) : null} - {window.innerWidth < 1000 ? ( -
- props.parent.setState({ selectedDelivery: props.data }) - } - > - - {props.data.name} - -
-

{props.data.price}

- تومان -
-
- ) : null} - - ); -}; - -const DiscoutCode = (props) => { - return ( - <> - {window.innerWidth > 1000 ? ( -
- props.parent.setState({ selectedDelivery: props.data }) - } - > - - {props.data.name} - -
-

- {props.data.price} -

- تومان -
-
- ) : null} - {window.innerWidth < 1000 ? ( -
-

کد تخفیف

-

- اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید و دکمه ثبت کد را - بزنید -

-
- - -
-
- ) : null} - - ); -}; - -const Factor = (props) => { - const { list, parent } = props; - - const totalPrice = () => { - let total = 0; - for (let i = 0; i < parent.state.list.length; i++) { - total += parent.state.list[i].price * parent.state.list[i].number; - } - return total; - }; - return ( - <> - {window.innerWidth < 1000 ? ( -
-

کد تخفیف

-

- اگر کد تخفیفی دارید آن را در کادر زیر وارد نمائید و دکمه ثبت کد را - بزنید -

-
- مبلغ سبد خرید - {totalPrice()} تومان -
-
- هزینه ارسال - {props.parent.state.selectedDelivery.price} تومان -
-
- میزان تخفیف - {props.parent.state.discount} تومان -
-
- ) : null} - - ); -}; - Cart.defaultProps = { payMethods: [ { diff --git a/src/views/Cart/index.scss b/src/views/Cart/index.scss index b8c688b..9900037 100644 --- a/src/views/Cart/index.scss +++ b/src/views/Cart/index.scss @@ -1,40 +1,56 @@ .cart { width: 100vw; - height: 100vh; max-width: 1250px; margin: 0px auto; - padding: 0px 10px; + padding: 0px; font-family: numeralLight; - &__right { - flex: 4; - padding: 10px 0px 0px; - header { - h1 { + padding-top: 100px; + &__totalPrice{ + padding: 20px 0px; + border-bottom: 1px dotted #A5A5A5; + padding-bottom: 20px; + + h3{ + font-family: numeralLight; + color: #00CC69; + margin: 0px; + } + div{ + margin-right: 20px; + strong{ font-family: numeralBold; - color: #373737; + color: #4D4D4F; + margin-left: 5px; } - } - table { - tr { - th { - font-family: numeralLight; - color: #afafaf; - } + span{ + font-family: numeralLight; + color: #848484; } } } + &__right { + flex: 4; + padding: 10px 0px 0px; + + } &__left { flex: 1.2; box-shadow: 0px 0px 13px #d5d5d5b0; border-radius: 13px; margin-right: 30px; + &--header { h2 { font-family: numeralBold; color: #2580ec; } + p { + font-family: numeralLight; + color: #a5a5a5; + letter-spacing: -1px; + } } - button { + &--submit{ justify-self: flex-end; padding: 12px; width: 100%; @@ -45,29 +61,6 @@ border-radius: 10px; margin-top: 50px; } - .delivery-methods { - padding: 6px; - border-radius: 10px; - border: 1px solid #88a9ff; - margin-top: 10px; - h3, - strong, - span { - font-family: numeralLight; - font-weight: 100; - margin: 0px; - } - strong { - width: 50%; - color: #678ef8; - letter-spacing: -1px; - } - h3, - span { - color: #02a255; - font-family: numeralMedium; - } - } } } @@ -95,29 +88,7 @@ font-family: numeralBold; color: #373737; } - &__totalPrice{ - padding: 20px 0px; - border-bottom: 1px dotted #A5A5A5; - padding-bottom: 20px; - - h3{ - font-family: numeralLight; - color: #00CC69; - margin: 0px; - } - div{ - margin-right: 20px; - strong{ - font-family: numeralBold; - color: #4D4D4F; - margin-left: 5px; - } - span{ - font-family: numeralLight; - color: #848484; - } - } - } + &__payMethods { border-bottom: 1px dotted #A5A5A5; margin-top: 20px; @@ -131,98 +102,9 @@ color: #a5a5a5; letter-spacing: -1px; } - .mobile-delivery-methods { - padding: 6px; - border-radius: 10px; - border: 1px solid #88a9ff; - margin-top: 10px; - width: 48%; - h3, - strong, - span { - font-family: numeralLight; - font-weight: 100; - margin: 0px; - } - strong { - // width: 50%; - color: #678ef8; - letter-spacing: -1px; - } - h3, - span { - color: #02a255; - font-family: numeralMedium; - } - } - } - .mobile-discount-code { - border-bottom: 1px dotted #A5A5A5; - margin-top: 20px; - padding-bottom: 20px; - h2 { - font-family: numeralBold; - color: #2580ec; - } - p { - font-family: numeralLight; - color: #a5a5a5; - letter-spacing: -1px; - } - &__box{ - border: 1px solid #2b95ff; - padding: 5px; - border-radius: 10px; - input { - color: #2b95ff; - font-family: numeralLight; - text-align: center; - padding: 5px; - border-radius: 10px; - border: 0px; - flex: 1; - direction: ltr; - &:focus{ - outline : none; - } - } - button { - border-radius: 10px; - background-color: #2b95ff; - font-family: numeralLight; - color: white; - padding: 10px 20px; - border: 0px; - } - } } - .mobile-factor{ - border-bottom: 1px dotted #A5A5A5; - margin-top: 20px; - padding-bottom: 20px; - h2 { - font-family: numeralBold; - color: #2580ec; - } - p { - font-family: numeralLight; - color: #a5a5a5; - letter-spacing: -1px; - } - div{ - margin-bottom: 10px; - strong{ - font-family: numeralLight; - color: #373737; - font-weight: 300; - } - span{ - font-family: numeralLight; - color: #373737; - } - } - } + } diff --git a/src/views/Contact/index.scss b/src/views/Contact/index.scss index 296d667..bbc9489 100644 --- a/src/views/Contact/index.scss +++ b/src/views/Contact/index.scss @@ -6,6 +6,7 @@ direction: rtl; min-height: calc(100vh - 288px); overflow-x: hidden; + padding-top: 100px; &__forms { width: 100%; justify-content: space-between; @@ -151,6 +152,9 @@ width: 100%; height: 430px; border-radius: 20px; + img{ + transform: scale(0.4); + } } } } diff --git a/src/views/Faq/index.scss b/src/views/Faq/index.scss index bbe93c7..71df8b1 100644 --- a/src/views/Faq/index.scss +++ b/src/views/Faq/index.scss @@ -5,6 +5,7 @@ padding: 0px 10px; direction: rtl; min-height: calc(100vh - 288px); + padding-top: 100px; &__header { margin-top: 30px; width: 600px; @@ -63,7 +64,7 @@ padding: 0px 10px; direction: rtl; overflow-x: hidden; - padding-top: 80px; + padding-top: 90px; &__header { margin-top: 30px; width: 100%; diff --git a/src/views/Home/HomeSlider/Blog/index.scss b/src/views/Home/HomeSlider/Blog/index.scss index ee209fc..afd3f11 100644 --- a/src/views/Home/HomeSlider/Blog/index.scss +++ b/src/views/Home/HomeSlider/Blog/index.scss @@ -6,6 +6,7 @@ width: 100%; text-decoration: none; position: relative; + max-width: 300px; img { width: 100%; height: 200px; diff --git a/src/views/Home/HomeSlider/Simple/index.js b/src/views/Home/HomeSlider/Simple/index.js index 93c4956..e8269b0 100644 --- a/src/views/Home/HomeSlider/Simple/index.js +++ b/src/views/Home/HomeSlider/Simple/index.js @@ -7,10 +7,10 @@ const maxDesktopSize = 1250; const fontSize = { desktop: { - h1: window.innerWidth > maxDesktopSize ? 22 : window.innerWidth / 65, - h2: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 85, - notAvailable: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 70, - available: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 70, + h1: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 65, + h2: window.innerWidth > maxDesktopSize ? 12 : window.innerWidth / 90, + notAvailable: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, + available: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 80, }, }; @@ -27,22 +27,26 @@ export default class Simple extends Component {

{data.title}

{data.subTitle}

{ - data.price ? -
- { - data.oldPrice ? -
-
- {data.oldPrice} تومان - -
- -
: null - } -
{data.price} تومان
-
: -
ناموجود
+ data.price !== undefined ? + + data.price ? +
+ { + data.oldPrice ? +
+
+ {data.oldPrice} تومان + +
+ +
: null + } +
{data.price} تومان
+
: +
ناموجود
+ : null } + diff --git a/src/views/Home/HomeSlider/Simple/index.scss b/src/views/Home/HomeSlider/Simple/index.scss index ff2a686..c643b57 100644 --- a/src/views/Home/HomeSlider/Simple/index.scss +++ b/src/views/Home/HomeSlider/Simple/index.scss @@ -3,13 +3,13 @@ a{ width : 100%; text-decoration: none; + max-width: 200px; &:hover{ } img{ width: 100%; - height: 300px; - border-top-left-radius: 15px; - border-top-right-radius: 15px; + height: 250px; + border-radius: 10px; } h1{ font-family: numeralBold; diff --git a/src/views/Home/HomeSlider/index.scss b/src/views/Home/HomeSlider/index.scss index cd05031..d0461c4 100644 --- a/src/views/Home/HomeSlider/index.scss +++ b/src/views/Home/HomeSlider/index.scss @@ -17,7 +17,7 @@ .home-slider { width: 100%; padding: 2px 0px 0px; - margin: 10px 0px 10px; + margin: 20px 0px 10px; position: relative; .rec-arrow-left{ top : calc(50% - 22px) !important; @@ -39,17 +39,17 @@ } .Carousel-button-10 { - background-color: white !important; + background-color: grey !important; } .rec-pagination { - z-index: 600; + z-index: 200; // left: calc(50% - 20px) !important; & button { background-color: grey; margin: 2px !important; - box-shadow: 0px 0px 0px rgba(255, 255, 255, 1); + box-shadow: 0px 0px 0px rgba(100, 100, 100, 1); &:focus{ - box-shadow: 0px 0px 0px rgba(255, 255, 255, 1); + box-shadow: 0px 0px 0px rgba(100, 100, 100, 1); } } } @@ -64,15 +64,15 @@ background-color: inherit !important; box-shadow: none !important; border: 0px !important; - color: white !important; + color: grey !important; &:focus{ - color: white !important; + color: grey !important; } &:disabled{ - color: #eee !important; + color: black !important; } &:enabled{ - color: white; + color: grey; } &:hover{ color: white; diff --git a/src/views/Home/Navbar/Laptop/index.scss b/src/views/Home/Navbar/Laptop/index.scss index 71f028f..431e626 100644 --- a/src/views/Home/Navbar/Laptop/index.scss +++ b/src/views/Home/Navbar/Laptop/index.scss @@ -6,6 +6,8 @@ font-family: numeralLight; z-index: 100; overflow: hidden; + background-color: white; + padding: 0px 10px 0px 20px; &::-webkit-scrollbar{ display: none; width: 0px; @@ -14,6 +16,8 @@ // width: 100px; // height: 50px; // background : greenyellow; + position: relative; + left: 14px; } &__list{ margin : 0px; diff --git a/src/views/Home/Navbar/index.scss b/src/views/Home/Navbar/index.scss index 9c29f0e..d3cd692 100644 --- a/src/views/Home/Navbar/index.scss +++ b/src/views/Home/Navbar/index.scss @@ -1,7 +1,11 @@ .navbar{ width: 100%; - position: fixed; - top: 0px; - left: 0px; + max-width: 1250px; + position: fixed !important; + top: 0px !important; overflow-x: hidden; -} \ No newline at end of file + background-color:white !important; + z-index: 200; + + // margin: 0px auto !important; +} diff --git a/src/views/Home/index.js b/src/views/Home/index.js index 22eb3e8..70aa052 100644 --- a/src/views/Home/index.js +++ b/src/views/Home/index.js @@ -471,7 +471,7 @@ Home.defaultProps = { type: window.innerWidth > 1000 ? "slider" : "scroll", title: "کتاب‌های من", moreText: 'لیست کتاب‌ها', - height: window.innerWidth > 1000 ? 470 : 270, + height: window.innerWidth > 1000 ? 340 : 270, design: window.innerWidth > 1000 ? "simple" : "myProduct", number: window.innerWidth > 1000 ? 4 : 2.8, data: [ @@ -554,7 +554,7 @@ Home.defaultProps = { type: window.innerWidth > 1000 ? "slider" : "scroll", title: "پرفروش‌ترین کتاب‌های دانوین", moreText: 'لیست کتاب‌ها', - height: window.innerWidth > 1000 ? 470 : 320, + height: window.innerWidth > 1000 ? 420 : 320, design: window.innerWidth > 1000 ? "simple" : "product", number: window.innerWidth > 1000 ? 4 : 2.8, data: [ @@ -650,7 +650,7 @@ Home.defaultProps = { { type: window.innerWidth > 1000 ? "slider" : "scroll", title: "جدیدترین کتاب‌های دانوین", - height: window.innerWidth > 1000 ? 470 : 320, + height: window.innerWidth > 1000 ? 420 : 320, design: window.innerWidth > 1000 ? "tab" : 'product', number: window.innerWidth > 1000 ? 4 : 3.5, moreText: 'لیست کتاب‌ها', diff --git a/src/views/Home/index.scss b/src/views/Home/index.scss index f97b82c..a9ffbe0 100644 --- a/src/views/Home/index.scss +++ b/src/views/Home/index.scss @@ -4,6 +4,7 @@ margin: 0px auto; padding : 0px 10px; direction: rtl; + padding-top: 100px; } diff --git a/src/views/MyBooks/index.scss b/src/views/MyBooks/index.scss index 915c241..7b498e5 100644 --- a/src/views/MyBooks/index.scss +++ b/src/views/MyBooks/index.scss @@ -5,6 +5,7 @@ padding : 0px 10px; direction: rtl; min-height: calc(100vh - 288px); + padding-top: 100px; } .mobile-mybooks{ diff --git a/src/views/Product/AddToCart/index.js b/src/views/Product/AddToCart/index.js index 85550b1..78c1516 100644 --- a/src/views/Product/AddToCart/index.js +++ b/src/views/Product/AddToCart/index.js @@ -37,7 +37,7 @@ export default function AddToCart(props) { خرید نسخه دیجیتال
diff --git a/src/views/Products/List/index.js b/src/views/Products/List/index.js index f96a3c9..4d13637 100644 --- a/src/views/Products/List/index.js +++ b/src/views/Products/List/index.js @@ -16,9 +16,26 @@ export default class List extends React.Component { sortList = sortList.sort((a, b) => (a.price < b.price && ( a.price !== '' || b.price !== '' ) ? -1 : 1)); } var filterList; - for(let j = 0; j <= parent.state.selectedFilters.subject.length; j++) { - filterList = sortList.filter(item => parent.state.selectedFilters.subject.indexOf(item.title) === -1); - }; + if(parent.state.selectedFilters.subject.length > 0 && parent.state.selectedFilters.level.length > 0){ + console.log(parent.state.selectedFilters.subject.length, parent.state.selectedFilters.level.length); + for(let j = 0; j < parent.state.selectedFilters.subject.length; j++) { + filterList = sortList.filter(item => item.title.indexOf(parent.state.selectedFilters.subject[j]) !== -1); + }; + for(let j = 0; j < parent.state.selectedFilters.level.length; j++) { + filterList = filterList.filter(item => item.subTitle.indexOf(parent.state.selectedFilters.level[j]) !== -1); + }; + }else if(parent.state.selectedFilters.level.length > 0){ + for(let j = 0; j < parent.state.selectedFilters.level.length; j++) { + filterList = sortList.filter(item => item.subTitle.indexOf(parent.state.selectedFilters.level[j]) !== -1); + }; + }else if(parent.state.selectedFilters.subject.length > 0){ + for(let j = 0; j < parent.state.selectedFilters.subject.length; j++) { + filterList = sortList.filter(item => item.title.indexOf(parent.state.selectedFilters.subject[j]) !== -1); + }; + }else{ + filterList = sortList; + } + return (
diff --git a/src/views/Products/index.js b/src/views/Products/index.js index 7e712e8..c619a6e 100644 --- a/src/views/Products/index.js +++ b/src/views/Products/index.js @@ -111,13 +111,13 @@ Products.defaultProps = { 'اول', 'دوم', 'سوم', - 'چهارم', + 'دهم', ], products: [ { id: 0, image: book1, - title: "کتاب علوم تجربی", + title: "کتاب شیمی آلی", subTitle: "پایه دهم ابتدایی", price: "78.000", oldPrice: "", diff --git a/src/views/Products/index.scss b/src/views/Products/index.scss index bbf1b5e..ff39a77 100644 --- a/src/views/Products/index.scss +++ b/src/views/Products/index.scss @@ -5,6 +5,7 @@ padding : 0px 10px; direction: rtl; min-height: calc(100vh - 288px); + padding-top: 100px; &__body{ margin-top: 20px; &--left{ diff --git a/src/views/QR/index.scss b/src/views/QR/index.scss index 3e3b440..66e8f30 100644 --- a/src/views/QR/index.scss +++ b/src/views/QR/index.scss @@ -128,6 +128,7 @@ direction: rtl; overflow-x: hidden; min-height: calc(100vh - 288px); + padding-top: 100px; .qr__sidebar { flex: 1; &--header { diff --git a/src/views/QRScan/index.scss b/src/views/QRScan/index.scss index 90630bf..4b6f50e 100644 --- a/src/views/QRScan/index.scss +++ b/src/views/QRScan/index.scss @@ -111,4 +111,5 @@ padding: 0px 10px; direction: rtl; overflow-x: hidden; + padding-top: 100px; }