diff --git a/src/components/CheckBox/index.js b/src/components/CheckBox/index.js new file mode 100644 index 0000000..de4def1 --- /dev/null +++ b/src/components/CheckBox/index.js @@ -0,0 +1,20 @@ +import React from "react"; + +function CheckBox({ text, onChange, checked, label, className = "" }) { + return ( + + ); +} +export default CheckBox; diff --git a/src/components/Layout/index.js b/src/components/Layout/index.js index 3b1fcfb..b91eab0 100644 --- a/src/components/Layout/index.js +++ b/src/components/Layout/index.js @@ -27,9 +27,10 @@ const subRoutes = [ [], [], [ - { id: 1, title: "لیست پیکها", path: "/delivery/deliverers" }, + { id: 1, title: "تخصیص پیک", path: "/delivery/assign" }, + { id: 2, title: "لیست پیکها", path: "/delivery/deliverers" }, { - id: 2, + id: 3, title: "لیست تحویلها", path: "/delivery/deliveries", }, diff --git a/src/components/OrderCard/index.js b/src/components/OrderCard/index.js index 7e82f13..4bbf1ee 100644 --- a/src/components/OrderCard/index.js +++ b/src/components/OrderCard/index.js @@ -3,11 +3,17 @@ import moment from "moment-jalaali"; import PropTypes from "prop-types"; import { Link } from "react-router-dom"; -import { ellipseText, englishNumberToPersianNumber, priceFormatter } from "../../../utils/helper"; +import { + ellipseText, + englishNumberToPersianNumber, + noOp, + priceFormatter, +} from "../../../utils/helper"; import Icon from "../Icon"; import { ICONS } from "../../../assets/images/icons"; +import CheckBox from "../CheckBox"; -function OrderCard({ order, link }) { +function OrderCard({ order, link, isBold, hasCheck, selected, onSelect }) { const { final_price: totalPrice, user_address: userAddress, @@ -26,7 +32,15 @@ function OrderCard({ order, link }) { (orderStatus === 0 && "#168FD4") || (orderStatus === 2 && "#E13F18") || "#67b977"; return ( <> - + { + if (hasCheck) { + e.preventDefault(); + onSelect(selected); + } + }} + className="d-flex px-0 u-cursor-pointer c-order-card overflow-hidden">