diff --git a/locales/en.json b/locales/en.json index fbda83c..bcc10dc 100644 --- a/locales/en.json +++ b/locales/en.json @@ -62,6 +62,7 @@ "dry-wash.arm.order.table.header.washingTime": "Washing Time", "dry-wash.arm.order.table.header.orderDate": "Order Date", "dry-wash.arm.order.table.header.status": "Status", + "dry-wash.arm.order.table.header.masters": "Master", "dry-wash.arm.order.table.header.telephone": "Telephone", "dry-wash.arm.order.table.header.location": "Location", "dry-wash.arm.master.title": "Masters", diff --git a/src/components/MasterActionsMenu/MasterActionsMenu.tsx b/src/components/MasterActionsMenu/MasterActionsMenu.tsx index 27d9ea2..384c4aa 100644 --- a/src/components/MasterActionsMenu/MasterActionsMenu.tsx +++ b/src/components/MasterActionsMenu/MasterActionsMenu.tsx @@ -9,6 +9,7 @@ import { } from '@chakra-ui/react'; import { EditIcon } from '@chakra-ui/icons'; import { useTranslation } from 'react-i18next'; + import { armService } from '../../api/arm'; interface MasterActionsMenu { diff --git a/src/components/MasterDrawer/MasterDrawer.tsx b/src/components/MasterDrawer/MasterDrawer.tsx index fa2b199..1f4ac79 100644 --- a/src/components/MasterDrawer/MasterDrawer.tsx +++ b/src/components/MasterDrawer/MasterDrawer.tsx @@ -16,9 +16,10 @@ import { InputLeftElement, } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; -import { armService } from '../../api/arm'; import { PhoneIcon } from '@chakra-ui/icons'; +import { armService } from '../../api/arm'; + const MasterDrawer = ({ isOpen, onClose }) => { const { addMaster } = armService(); const toast = useToast(); diff --git a/src/components/MasterItem/MasterItem.tsx b/src/components/MasterItem/MasterItem.tsx index 15f590d..23c683a 100644 --- a/src/components/MasterItem/MasterItem.tsx +++ b/src/components/MasterItem/MasterItem.tsx @@ -2,25 +2,32 @@ import React from 'react'; import { Badge, Link, Stack, Td, Tr } from '@chakra-ui/react'; import MasterActionsMenu from '../MasterActionsMenu'; -import { getTimeSlot } from '../../lib/date-helpers'; +import { getTimeSlot } from '../../lib'; + +export interface Schedule { + id: string; + startWashTime: string; + endWashTime: string; +} export type MasterProps = { id: string; name: string; phone: string; + schedule: Schedule[]; }; -const MasterItem = ({ name, phone, id }) => { +const MasterItem = ({ name, phone, id, schedule }) => { return ( {name} - {/*{schedule.map(({ startWashTime, endWashTime }, index) => (*/} - {/* */} - {/* {getTimeSlot(startWashTime, endWashTime)}*/} - {/* */} - {/*))}*/} + {schedule.map(({ startWashTime, endWashTime }, index) => ( + + {getTimeSlot(startWashTime, endWashTime)} + + ))} diff --git a/stubs/api/index.js b/stubs/api/index.js index ae73c8f..f360596 100644 --- a/stubs/api/index.js +++ b/stubs/api/index.js @@ -8,8 +8,8 @@ const commonError = { success: false, message: 'Что-то пошло не та const sleep = (duration = 1000) => - (req, res, next) => - setTimeout(next, duration); + (req, res, next) => + setTimeout(next, duration); router.use(sleep());