diff --git a/src/assets/images/book-mini.svg b/src/assets/images/book-mini.svg new file mode 100644 index 0000000..0038b77 --- /dev/null +++ b/src/assets/images/book-mini.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/components/Navbar/index.js b/src/components/Navbar/index.js index a2a1fde..27fa013 100644 --- a/src/components/Navbar/index.js +++ b/src/components/Navbar/index.js @@ -43,7 +43,7 @@ function Navbar({ pages, isDark, headerOptions }) {
} /> + + } + /> + + } + /> -

No matches routes.

- + } /> diff --git a/src/views/404/404.svg b/src/views/404/404.svg new file mode 100644 index 0000000..b00a58d --- /dev/null +++ b/src/views/404/404.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/views/404/index.js b/src/views/404/index.js new file mode 100644 index 0000000..a819ffc --- /dev/null +++ b/src/views/404/index.js @@ -0,0 +1,36 @@ +import React, { useEffect } from "react"; +import { connect } from "react-redux"; +import notFoundImage from "./404.svg"; +import { publicApi } from "../../redux/actions"; + +function NotFound({ headerOptions, setHeaderOptions }) { + useEffect(() => { + setHeaderOptions(headerOptions); + }, []); + return ( +
+

+ 404 +

+ 404 +

+ وای!! +
+ صفحه ای که بدنبال آن بوده‌اید دیگر وجود ندارد :( +

+
+ ); +} + +const mapStateToProps = (state) => ({}); + +const mapDispatchToProps = { + setHeaderOptions: publicApi.setHeaderOptions, +}; +export default connect(mapStateToProps, mapDispatchToProps)(NotFound); diff --git a/src/views/Order/assets/b1.png b/src/views/Order/assets/b1.png new file mode 100644 index 0000000..409f943 Binary files /dev/null and b/src/views/Order/assets/b1.png differ diff --git a/src/views/Order/components/Book.js b/src/views/Order/components/Book.js new file mode 100644 index 0000000..3f7f89a --- /dev/null +++ b/src/views/Order/components/Book.js @@ -0,0 +1,27 @@ +import React from "react"; +import _ from "lodash"; + +export default function Book({ book }) { + return ( +
+
+ +
+ علوم اجتماعی + پایه دوم + نسخه دیجیتال +
+
+
+ + 1 + +
126.000 تومان
+
+
+ ); +} diff --git a/src/views/Order/index.js b/src/views/Order/index.js new file mode 100644 index 0000000..f92e3cb --- /dev/null +++ b/src/views/Order/index.js @@ -0,0 +1,158 @@ +import React, { useEffect } from "react"; +import Book from "./components/Book"; +import { connect } from "react-redux"; +import {publicApi} from '../../redux/actions'; +import b1Image from "./assets/b1.png"; +import _ from "lodash"; + +const colors = { + 1: "#FFF700", + 4: "#FF0000", + 3: "#4CFF00", + 2: "#196EC0", +}; + +const status = { + 1: "در حال پردازش", + 4: "درخواست رد شد", + 3: "تکمیل شد", + 2: "ارسال شده", +}; + +function OrderDetails({ order, setHeaderOptions, headerOptions }) { + useEffect(() => { + setHeaderOptions(headerOptions); + },[]); + return ( +
+
+ + {_.join(["شماره سفارش:", order.number], " ")} + +
+ + {status[order.status]} + +
+
+
+
+ آدرس تحویل: + + {order.address} + +
+
+
+ مشخصات تحویل گیرنده: + + {order.name} + +
+
+ شماره موبایل: + + {order.cellphone} + +
+
+
+ + {_.join(["کد تحویل", order.receiveCode], " ")} + +

+ این کد را پس از دریافت کالا، به مامور ارسال دانوین اعلام فرمایید +

+
+
+ {order.items.map((item, index) => ( + + ))} +
+
+
+ مبلغ سبد خرید: + + {_.join([order.shoppingCardPrice, "تومان"], " ")} + +
+
+ تخفیف: + + {_.join([order.discountPrice, "تومان"], " ")} + +
+
+
+
+ هزینه ارسال کالا: + + {_.join([order.sendPrice, "تومان"], " ")} + +
+
+ جمع هزینه پرداختی: + + {_.join([order.totalPrice, "تومان"], " ")} + +
+
+
+
+ نحوه پرداخت: + + {order.payMethod} + +
+
+ شماره تراکنش: + + {order.transactionNumber} + +
+
+
+
+ تاریخ تحویل: + + {order.date} + +
+
+
+ ); +} + +const mapStateToProps = (state) => ({ + +}); + +const mapDispatchToProps = { + setHeaderOptions: publicApi.setHeaderOptions, +} + +export default connect(mapStateToProps, mapDispatchToProps)(OrderDetails); + +OrderDetails.defaultProps = { + order: { + number: "535353523653", + receiveCode: "300031", + status: 2, + items: [b1Image, b1Image], + date: "1400/1/11", + cost: "1.240.000", + address: + "تهران خیابان انقلاب حدفاصل ابوریحان و فلسطین بن بست سروش پلاک 2 واحد 12 شرقی", + name: "هومن عابدی", + cellphone: "09121234568", + shoppingCardPrice: "981.000", + discountPrice: "12.000", + sendPrice: "18.000", + totalPrice: "18.000", + payMethod: "حضوری", + transactionNumber: " BS3194DNB98312", + }, +}; diff --git a/src/views/Orders/assets/leftArrow.png b/src/views/Orders/assets/leftArrow.png new file mode 100644 index 0000000..1108ed5 Binary files /dev/null and b/src/views/Orders/assets/leftArrow.png differ diff --git a/src/views/Orders/assets/plus.png b/src/views/Orders/assets/plus.png new file mode 100644 index 0000000..16ea095 Binary files /dev/null and b/src/views/Orders/assets/plus.png differ diff --git a/src/views/Orders/components/Order.js b/src/views/Orders/components/Order.js new file mode 100644 index 0000000..5a46222 --- /dev/null +++ b/src/views/Orders/components/Order.js @@ -0,0 +1,106 @@ +import React from "react"; +import { Link } from "react-router-dom"; +import leftArrowIcon from "../assets/leftArrow.png"; +import _ from "lodash"; + +const colors = { + 1: "#FFF700", + 4: "#FF0000", + 3: "#4CFF00", + 2: "#196EC0", +}; + +const status = { + 1: "در حال پردازش", + 4: "درخواست رد شد", + 3: "تکمیل شد", + 2: "ارسال شده", +}; + +function Order({ order }) { + return ( +
+
+ + {_.join(["شماره سفارش:", order.number], " ")} + +
+ + {status[order.status]} + +
+
+
+
+
+
+ {order.items.length < 2 + ? order?.items?.map((item) => ( + + )) + : order.items + ?.slice(0, 1) + ?.map((item) => ( + + ))} + {order.items.length >= 2 && ( +
+ )} +
+
+
+ {_.join(["کد تحویل:", order.receiveCode], " ")} +
+
+
+
+ + {_.join(["جمع فاکتور:", order.cost], " ")} + + + جزئیات سفارش + + + + {_.join(["تاریخ سفارش:", order.date], " ")} + +
+
+
+ ); +} + +export default Order; diff --git a/src/views/Orders/index.js b/src/views/Orders/index.js new file mode 100644 index 0000000..e38b63e --- /dev/null +++ b/src/views/Orders/index.js @@ -0,0 +1,56 @@ +import React, { useEffect } from "react"; +import Order from "./components/Order"; +import { connect } from "react-redux"; +import { publicApi } from "../../redux/actions"; +//assets +import bookImage from "../../assets/images/book-mini.svg"; + +function Orders({ orders, headerOptions, setHeaderOptions }) { + useEffect(() => { + setHeaderOptions(headerOptions); + }, []); + return ( +
+ {orders.map((order, index) => ( + + ))} +
+ ); +} + +const mapStateToProps = (state) => ({}); + +const mapDispatchToProps = { + setHeaderOptions: publicApi.setHeaderOptions, +}; + +export default connect(mapStateToProps, mapDispatchToProps)(Orders); + +Orders.defaultProps = { + orders: [ + { + number: "535353523653", + receiveCode: "300031", + status: 2, + items: [bookImage, bookImage, bookImage, bookImage], + date: "1400/1/12", + cost: "1.240.000", + }, + { + number: "535353523653", + receiveCode: "300031", + status: 3, + items: [bookImage, bookImage, bookImage], + date: "1400/1/12", + cost: "1.240.000", + }, + { + number: "535353523653", + receiveCode: "300031", + status: 4, + items: [bookImage, bookImage, bookImage], + date: "1400/1/12", + cost: "1.240.000", + }, + ], +}; diff --git a/tailwind.config.js b/tailwind.config.js index ec38512..effd994 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -32,6 +32,7 @@ module.exports = { ...theme("colors"), primary: "#235A90", blueC0: "#196EC0", + blueC01: "#1999C0", blueE8: "#2E81E8", blue52: "#132F52", blue5F: "#05335F", @@ -47,10 +48,13 @@ module.exports = { borderColor: (theme) => ({ ...theme("colors"), blueC0: "#196EC0", + blueC01: "#1999C0", blueFE: "#C1E0FE", + blueFF1: "#E9F0FF", blueB9: '#86A0B9', grayDB: "#DBDBDB", gray45: "#454545", + }), fill: (theme) => ({ ...theme("colors"),