Compare commits
2 Commits
1dee68b65d
...
9b0bda3cda
Author | SHA1 | Date | |
---|---|---|---|
9b0bda3cda | |||
cad31605d9 |
@ -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",
|
||||
|
@ -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 {
|
||||
|
@ -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();
|
||||
|
@ -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 (
|
||||
<Tr>
|
||||
<Td>{name}</Td>
|
||||
<Td>
|
||||
<Stack direction='row'>
|
||||
{/*{schedule.map(({ startWashTime, endWashTime }, index) => (*/}
|
||||
{/* <Badge colorScheme={'green'} key={index}>*/}
|
||||
{/* {getTimeSlot(startWashTime, endWashTime)}*/}
|
||||
{/* </Badge>*/}
|
||||
{/*))}*/}
|
||||
{schedule.map(({ startWashTime, endWashTime }, index) => (
|
||||
<Badge colorScheme={'green'} key={index}>
|
||||
{getTimeSlot(startWashTime, endWashTime)}
|
||||
</Badge>
|
||||
))}
|
||||
</Stack>
|
||||
</Td>
|
||||
<Td>
|
||||
|
@ -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());
|
||||
|
||||
|
@ -4,11 +4,31 @@
|
||||
{
|
||||
"id": "masters1",
|
||||
"name": "Иван Иванов",
|
||||
"schedule": [ {
|
||||
"id": "order1",
|
||||
"startWashTime": "2024-11-24T10:30:00.000Z",
|
||||
"endWashTime": "2024-11-24T16:30:00.000Z"
|
||||
},
|
||||
{
|
||||
"id": "order2",
|
||||
"startWashTime": "2024-11-24T11:30:00.000Z",
|
||||
"endWashTime": "2024-11-24T17:30:00.000Z"
|
||||
}],
|
||||
"phone": "+7 900 123 45 67"
|
||||
},
|
||||
{
|
||||
"id": "masters12",
|
||||
"name": "Иван Иванов",
|
||||
"schedule": [ {
|
||||
"id": "order1",
|
||||
"startWashTime": "2024-11-24T10:30:00.000Z",
|
||||
"endWashTime": "2024-11-24T16:30:00.000Z"
|
||||
},
|
||||
{
|
||||
"id": "order2",
|
||||
"startWashTime": "2024-11-24T11:30:00.000Z",
|
||||
"endWashTime": "2024-11-24T17:30:00.000Z"
|
||||
}],
|
||||
"phone": "+7 900 123 45 67"
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user