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">
-
+ {hasCheck && ( + + )} +
{orderDate.getMonth() === nowDate.getMonth() && orderDate.getFullYear() === nowDate.getFullYear() && orderDate.getDate() === nowDate.getDate() ? ( diff --git a/src/components/Pagination/index.js b/src/components/Pagination/index.js index c69d3d4..62ae390 100644 --- a/src/components/Pagination/index.js +++ b/src/components/Pagination/index.js @@ -30,7 +30,7 @@ function Pagination({ location, pagination }) {
{pages[0] + 1 < pagination.pagesCount && (
- +
{englishNumberToPersianNumber(pagination.pagesCount)}
@@ -41,7 +41,7 @@ function Pagination({ location, pagination }) { {pages.map((p) => (
0 && (
... - +
۱
diff --git a/src/containers/App/index.js b/src/containers/App/index.js index 011c5af..476364f 100644 --- a/src/containers/App/index.js +++ b/src/containers/App/index.js @@ -27,6 +27,7 @@ import CreateDeliverer from "../CreateDeliverer"; import EditDeliverer from "../EditDeliverer"; import DeliveriesList from "../DeliveriesList"; import PrinterSettings from "../PrinterSettings"; +import AssignDeliverer from "../AssignDeliverer"; const App = function ({ history, @@ -74,14 +75,17 @@ const App = function ({ + + + - + diff --git a/src/containers/AssignDeliverer/actions.js b/src/containers/AssignDeliverer/actions.js new file mode 100644 index 0000000..91340ca --- /dev/null +++ b/src/containers/AssignDeliverer/actions.js @@ -0,0 +1,39 @@ +/* + * + * Admin actions + * + */ + +import { + SET_FOOD_ADMIN_ORDERS, + DEFAULT_ACTION, + GET_FOOD_ADMIN_ORDERS, + SET_DELIVERERS, +} from "./constants"; + +export function defaultAction() { + return { + type: DEFAULT_ACTION, + }; +} + +export function getFoodAdminOrders(page) { + return { + type: GET_FOOD_ADMIN_ORDERS, + data: page, + }; +} + +export function setFoodAdminOrders(data, pagination) { + return { + type: SET_FOOD_ADMIN_ORDERS, + data, + pagination, + }; +} +export function setDeliverers(data) { + return { + type: SET_DELIVERERS, + data, + }; +} diff --git a/src/containers/AssignDeliverer/constants.js b/src/containers/AssignDeliverer/constants.js new file mode 100644 index 0000000..7ced0aa --- /dev/null +++ b/src/containers/AssignDeliverer/constants.js @@ -0,0 +1,12 @@ +/* + * + * Admin constants + * + */ + +export const DEFAULT_ACTION = 'app/AssignDeliverer/DEFAULT_ACTION'; +export const GET_FOOD_ADMIN_ORDERS = 'app/AssignDeliverer/GET_FOOD_ADMIN_ORDERS'; +export const SET_FOOD_ADMIN_ORDERS = 'app/AssignDeliverer/SET_FOOD_ADMIN_ORDERS'; +export const SET_DELIVERERS = 'app/AssignDeliverer/SET_DELIVERERS'; + +export const ORDERS_PAGE_SIZE = 20; diff --git a/src/containers/AssignDeliverer/index.js b/src/containers/AssignDeliverer/index.js new file mode 100644 index 0000000..a2574f5 --- /dev/null +++ b/src/containers/AssignDeliverer/index.js @@ -0,0 +1,182 @@ +import "../../../styles/_main.scss"; +import { withRouter } from "react-router-dom"; +import { compose } from "redux"; +import React, { memo, useCallback, useEffect, useState } from "react"; +import { createStructuredSelector } from "reselect"; +import { useInjectReducer } from "../../../utils/injectReducer"; +import { useInjectSaga } from "../../../utils/injectSaga"; +import { makeSelectOrders, makeSelectOrdersPagination } from "./selectors"; +import { getFoodAdminOrders, setDeliverers } from "./actions"; + +import reducer from "./reducer"; +import saga from "./saga"; +import { connect } from "react-redux"; +import OrderCard from "../../components/OrderCard"; +import { englishNumberToPersianNumber, getQueryParams } from "../../../utils/helper"; +import Pagination from "../../components/Pagination"; +import CheckBox from "../../components/CheckBox"; +import Icon from "../../components/Icon"; +import { ICONS } from "../../../assets/images/icons"; +import { makeSelectPlugin } from "../../../stores/business/selector"; +import { makeSelectLoading } from "../App/selectors"; + +const AssignDeliverer = function ({ + _getAdminOrders, + orders, + pagination, + location, + pluginData, + _setDeliverers, + loading, + history, +}) { + useInjectReducer({ key: "assignDeliverer", reducer }); + useInjectSaga({ key: "assignDeliverer", saga }); + const [selected, setSelected] = useState([]); + const [sendSms, setSendSms] = useState(true); + const [deliverer, setDeliverer] = useState(""); + + const page = getQueryParams("page", location.search) || 1; + useEffect(() => { + _getAdminOrders(page); + }, [location]); + useEffect(() => { + setSelected(orders.map(() => false)); + }, [orders]); + const deliverers = + pluginData.data && pluginData.data.deliverers ? pluginData.data.deliverers : []; + const assign = useCallback( + (deliverer) => () => { + if (loading) return; + setDeliverer(deliverer); + const orderIds = []; + selected.map((isSelected, index) => { + if (isSelected) return orderIds.push(orders[index].id); + }); + if (!orderIds.length) return; + _setDeliverers({ + deliverer, + sendSms, + orders: orderIds, + page, + }); + }, + [selected, sendSms] + ); + return ( +
+
+
+
+ + setSelected(orders.map(() => checked))} + label={`defaultCheck`} + /> + {selected.some(Boolean) && ( +
+ {englishNumberToPersianNumber(selected.filter((s) => s === true).length)} سفارش + انتخاب شده ... +
+ )} +
+ {selected.some((s, index) => s && orders[index].deliverer_name) && ( +
+ + حذف پیک +
+ )} +
+
+
+ {orders.map((order, index) => ( + { + let newSelected = [...selected]; + newSelected[index] = !selected[index]; + setSelected(newSelected); + }} + isBold={!order.deliverer_name} + key={`order-${order.id}`} + order={order} + /> + ))} +
+
+ +
+ {deliverers.length ? ( +
+
+
+
+ + پیک‌ها +
+
history.push("/delivery/deliveries")}> + لیست تحویل‌ها + +
+
+ {selected.some(Boolean) && ( +
پیک‌ موردنظر را انتخاب کنید...
+ )} +
+ +
+
+ {deliverers.map((d) => ( +
+ {d.name} +
+ ))} +
+
+
+ ) : null} +
+ ); +}; + +const mapStateToProps = createStructuredSelector({ + orders: makeSelectOrders(), + pluginData: makeSelectPlugin(), + pagination: makeSelectOrdersPagination(), + loading: makeSelectLoading(), +}); + +function mapDispatchToProps(dispatch) { + return { + _getAdminOrders: (page) => dispatch(getFoodAdminOrders(page)), + _setDeliverers: (data) => dispatch(setDeliverers(data)), + }; +} + +const withConnect = connect(mapStateToProps, mapDispatchToProps); +export default compose(withConnect, withRouter, memo)(AssignDeliverer); diff --git a/src/containers/AssignDeliverer/reducer.js b/src/containers/AssignDeliverer/reducer.js new file mode 100644 index 0000000..9ee3e60 --- /dev/null +++ b/src/containers/AssignDeliverer/reducer.js @@ -0,0 +1,27 @@ +/* + * + * Admin reducer + * + */ +import produce from "immer"; +import { SET_FOOD_ADMIN_ORDERS, DEFAULT_ACTION } from "./constants"; + +export const initialState = { + orders: [], + ordersPagination: {}, +}; + +/* eslint-disable default-case, no-param-reassign */ +const adminReducer = (state = initialState, action) => + produce(state, (draft) => { + switch (action.type) { + case SET_FOOD_ADMIN_ORDERS: + draft.orders = action.data; + draft.ordersPagination = action.pagination; + break; + case DEFAULT_ACTION: + break; + } + }); + +export default adminReducer; diff --git a/src/containers/AssignDeliverer/saga.js b/src/containers/AssignDeliverer/saga.js new file mode 100644 index 0000000..a461c4a --- /dev/null +++ b/src/containers/AssignDeliverer/saga.js @@ -0,0 +1,59 @@ +/* eslint-disable no-console */ +import { call, put, takeLatest, select } from "@redux-saga/core/effects"; + +import request from "../../../utils/request"; +import { BUSINESS_ORDERS_API, ORDERS_LIST_DELIVERER_API } from "../../../utils/api"; +import { getFoodAdminOrders, setFoodAdminOrders } from "./actions"; +import { GET_FOOD_ADMIN_ORDERS, ORDERS_PAGE_SIZE, SET_DELIVERERS } from "./constants"; +import { makeSelectSubDomain } from "../App/selectors"; +import { startLoading, stopLoading } from "../App/actions"; +import { setSnackBarMessage } from "../../../stores/ui/actions"; + +export function* getOrdersFunc(action) { + try { + const domain = yield select(makeSelectSubDomain()); + const page = action.data || 1; + const { + response: { data, pagination }, + } = yield call(request, BUSINESS_ORDERS_API("food", page, ORDERS_PAGE_SIZE), { domain }, "GET"); + const pagesCount = Math.ceil(pagination.count / ORDERS_PAGE_SIZE); + + if (data) { + yield put(setFoodAdminOrders(data, { ...pagination, pagesCount })); + } + } catch (err) { + console.log(err); + yield put(stopLoading()); + } +} +export function* setDeliverers(action) { + try { + yield put(startLoading()); + if (action.data.deliverer || action.data.deliverer === "") { + const { + response: { data }, + } = yield call( + request, + ORDERS_LIST_DELIVERER_API(action.data.id, "food"), + { + deliverer_name: action.data.deliverer, + send_sms: action.data.sendSms, + orders: action.data.orders, + }, + "PATCH" + ); + if (data) { + yield put(getFoodAdminOrders(action.data.page)); + yield put(setSnackBarMessage("تخصیص پیک با موفقیت انجام شد.", "success")); + } else yield put(setSnackBarMessage("در تخصیص پیک خطایی رخ داده است!", "fail")); + } + yield put(stopLoading()); + } catch (err) { + yield put(setSnackBarMessage("در تایید سفارش خطایی رخ داده است!", "fail")); + yield put(stopLoading()); + } +} +export default function* adminPanelAppSaga() { + yield takeLatest(GET_FOOD_ADMIN_ORDERS, getOrdersFunc); + yield takeLatest(SET_DELIVERERS, setDeliverers); +} diff --git a/src/containers/AssignDeliverer/selectors.js b/src/containers/AssignDeliverer/selectors.js new file mode 100644 index 0000000..0eb86d2 --- /dev/null +++ b/src/containers/AssignDeliverer/selectors.js @@ -0,0 +1,24 @@ +import { createSelector } from "reselect"; +import { initialState } from "./reducer"; + +/** + * Direct selector to the admin state domain + */ + +const selectAdminDomain = (state) => state.assignDeliverer || initialState; + +/** + * Other specific selectors + */ + +/** + * Default selector used by Admin + */ + +const makeSelectAdmin = () => createSelector(selectAdminDomain, (substate) => substate); +const makeSelectOrders = () => createSelector(selectAdminDomain, (state) => state.orders); +const makeSelectOrdersPagination = () => + createSelector(selectAdminDomain, (state) => state.ordersPagination); + +export default makeSelectAdmin; +export { selectAdminDomain, makeSelectOrdersPagination, makeSelectOrders }; diff --git a/src/containers/OnlineOrder/index.js b/src/containers/OnlineOrder/index.js index 98b277f..7cb1495 100644 --- a/src/containers/OnlineOrder/index.js +++ b/src/containers/OnlineOrder/index.js @@ -35,6 +35,7 @@ import PrintModal from "./components/PrintModal"; import { ipcRenderer } from "electron"; import { renderToString } from "react-dom/server"; import ComponentToPrint from "../../components/ComponentToPrint"; +import CheckBox from "../../components/CheckBox"; export function OnlineOrder({ adminOrder: order, @@ -169,19 +170,12 @@ export function OnlineOrder({
{order.order_status === 0 && (
- +
)}
diff --git a/src/containers/OnlineOrders/index.js b/src/containers/OnlineOrders/index.js index 6988bad..802eb4f 100644 --- a/src/containers/OnlineOrders/index.js +++ b/src/containers/OnlineOrders/index.js @@ -36,10 +36,11 @@ const OnlineOrders = function ({ _getAdminOrders, adminOrders: orders, paginatio
+ style={{ height: "calc(100% - 98px)" }}>
{orders.map((order) => (
{s.title}
{s.sections.map((o) => ( - + className={`u-text-black u-fontMedium mt-2 ${o.className}`} + checked={!printerOptions.factor[o.field]} + onChange={(checked) => { + let newPrinters = [...printOptions.printers]; + newPrinters[index] = { + ...newPrinters[index], + factor: { ...printerOptions.factor, [o.field]: !checked }, + }; + save({ + printers: newPrinters, + }); + }} + label={`defaultCheck${o.id}`} + /> ))}
))} diff --git a/styles/_main.scss b/styles/_main.scss index af1c1cd..77b9939 100644 --- a/styles/_main.scss +++ b/styles/_main.scss @@ -1,20 +1,20 @@ -@import './varibles/_varibles'; -@import './mixin/_mixin'; -@import './base/_base'; -@import './components/_components'; -@import './reset/_reset'; -@import './utils/_utilis'; -@import './fonts/_fonts'; -@import './bootstrap/bootstrap.scss'; -@import './input.scss'; -@import './flickity.scss'; -@import './leaflet.scss'; -@import './checkbox.scss'; -@import './fixed_container.scss'; -@import './radio.scss'; -@import './radio_button'; -@import './rate'; -@import './pulse'; +@import "./varibles/_varibles"; +@import "./mixin/_mixin"; +@import "./base/_base"; +@import "./components/_components"; +@import "./reset/_reset"; +@import "./utils/_utilis"; +@import "./fonts/_fonts"; +@import "./bootstrap/bootstrap.scss"; +@import "./input.scss"; +@import "./flickity.scss"; +@import "./leaflet.scss"; +@import "./checkbox.scss"; +@import "./fixed_container.scss"; +@import "./radio.scss"; +@import "./radio_button"; +@import "./rate"; +@import "./pulse"; .tab { border-bottom: 2px solid #ffffff; @@ -182,7 +182,7 @@ body { align-items: center; } -input:not([type='checkbox']) { +input:not([type="checkbox"]) { &:focus + label, &.notEmpty + label { transition: all 0.2s ease-in-out; @@ -513,86 +513,86 @@ input:not([type='checkbox']) { @-webkit-keyframes load4 { 0%, 100% { - box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, - 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0; + box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, + -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0; } 12.5% { - box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, - 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, + -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em; } 25% { - box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, - 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, 0 3em 0 -1em, + -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em; } 37.5% { - box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, - 0 3em 0 0em, -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, + -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em; } 50% { - box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, - 0 3em 0 0.2em, -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, + -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em; } 62.5% { - box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, - 0 3em 0 0, -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, + -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em; } 75% { - box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, - 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0; + box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, + -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0; } 87.5% { - box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, - 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em; + box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, + -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em; } } @keyframes load4 { 0%, 100% { - box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, - 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0; + box-shadow: 0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, + -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0; } 12.5% { - box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, - 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, + -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em; } 25% { - box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, - 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, 0 3em 0 -1em, + -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em; } 37.5% { - box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, - 0 3em 0 0em, -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, + -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em; } 50% { - box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, - 0 3em 0 0.2em, -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, + -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em; } 62.5% { - box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, - 0 3em 0 0, -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em; + box-shadow: 0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, + -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em; } 75% { - box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, - 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0; + box-shadow: 0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, + -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0; } 87.5% { - box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, - 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em; + box-shadow: 0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, + -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em; } } @@ -629,7 +629,7 @@ input:not([type='checkbox']) { } .Toastify__toast-body { - font-family: 'IranSans'; + font-family: "IranSans"; } .no-border { @@ -1824,7 +1824,7 @@ h6 { .ichEditor-root { background: #fff; border: 1px solid #ddd; - font-family: 'Georgia', serif; + font-family: "Georgia", serif; font-size: 14px; padding: 15px; } @@ -1859,7 +1859,7 @@ h6 { .RichEditor-editor .RichEditor-blockquote { border-left: 5px solid #eee; color: #666; - font-family: 'Hoefler Text', 'Georgia', serif; + font-family: "Hoefler Text", "Georgia", serif; font-style: italic; margin: 16px 0; padding: 10px 20px; @@ -1867,13 +1867,13 @@ h6 { .RichEditor-editor .public-DraftStyleDefault-pre { background-color: rgba(0, 0, 0, 0.05); - font-family: 'Inconsolata', 'Menlo', 'Consolas', monospace; + font-family: "Inconsolata", "Menlo", "Consolas", monospace; font-size: 16px; padding: 20px; } .RichEditor-controls { - font-family: 'Helvetica', sans-serif; + font-family: "Helvetica", sans-serif; font-size: 14px; margin-bottom: 5px; user-select: none; @@ -2001,7 +2001,7 @@ h6 { } .MuiSnackbarContent-root { - font-family: 'IranSans' !important; + font-family: "IranSans" !important; white-space: pre-wrap; } } @@ -2136,3 +2136,7 @@ h6 { .badge-shadow { box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.15); } + +.header-shadow { + box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1); +} diff --git a/styles/checkbox.scss b/styles/checkbox.scss index b63fc6f..3b02bd1 100644 --- a/styles/checkbox.scss +++ b/styles/checkbox.scss @@ -1,5 +1,6 @@ /* Customize the label (the container) */ .checkbox-container { + min-height: 20px; display: block; position: relative; padding-right: 25px; @@ -64,4 +65,4 @@ -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); -} \ No newline at end of file +} diff --git a/utils/api.js b/utils/api.js index 51b49ba..17e622c 100644 --- a/utils/api.js +++ b/utils/api.js @@ -78,6 +78,9 @@ export const ORDER_DELIVERY_TIME_API = (id, plugin) => export const ORDER_DELIVERER_API = (id, plugin) => `${BASE_URL}${plugin}_orders/${id}/set_deliverer_name/`; +export const ORDERS_LIST_DELIVERER_API = (id, plugin) => + `${BASE_URL}${plugin}_orders/set_orders_list_deliverer/`; + // Plugins API export const PLUGIN_TRIAL_API = slug => `${BASE_URL}businesses/${slug}/enable_plugin_trial/`;