Compare commits
No commits in common. "3ade6f83cc24dbb5e239c14428afea87bd7a27f1" and "d2b74a1467ddc301973a127edf2394b44183ef13" have entirely different histories.
3ade6f83cc
...
d2b74a1467
@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
"dry-wash.arm.master.add": "Добавить",
|
|
||||||
"dry-wash.arm.order.title": "Заказы",
|
|
||||||
"dry-wash.arm.order.status.progress": "Выполняется",
|
|
||||||
"dry-wash.arm.order.status.complete": "Завершено",
|
|
||||||
"dry-wash.arm.order.status.pending": "в ожидании",
|
|
||||||
"dry-wash.arm.order.status.working": "В работе",
|
|
||||||
"dry-wash.arm.order.status.canceled": "Отменено",
|
|
||||||
"dry-wash.arm.order.status.placeholder": "Выберите статус",
|
|
||||||
"dry-wash.arm.order.table.header.carNumber": "Номер машины",
|
|
||||||
"dry-wash.arm.order.table.header.washingTime": "Время мойки",
|
|
||||||
"dry-wash.arm.order.table.header.orderDate": "Дата заказа",
|
|
||||||
"dry-wash.arm.order.table.header.status": "Статус",
|
|
||||||
"dry-wash.arm.order.table.header.telephone": "Телефон",
|
|
||||||
"dry-wash.arm.order.table.header.location": "Расположение",
|
|
||||||
"dry-wash.arm.master.title": "Мастера",
|
|
||||||
"dry-wash.arm.master.table.header.name": "Имя",
|
|
||||||
"dry-wash.arm.master.table.header.currentJob": "Актуальная занятость",
|
|
||||||
"dry-wash.arm.master.table.header.phone": "Телефон",
|
|
||||||
"dry-wash.arm.master.table.header.actions": "Действия",
|
|
||||||
"dry-wash.arm.master.table.actionsMenu.delete": "Удалить мастера",
|
|
||||||
"dry-wash.arm.master.drawer.title": "Добавить нового мастера",
|
|
||||||
"dry-wash.arm.master.drawer.inputName.label": "ФИО",
|
|
||||||
"dry-wash.arm.master.drawer.inputName.placeholder": "Введите ФИО",
|
|
||||||
"dry-wash.arm.master.drawer.inputPhone.label": "Номер телефона",
|
|
||||||
"dry-wash.arm.master.drawer.inputPhone.placeholder": "Введите номер телефона",
|
|
||||||
"dry-wash.arm.master.drawer.button.save": "Сохранить",
|
|
||||||
"dry-wash.arm.master.drawer.button.cancel": "Отменить",
|
|
||||||
"dry-wash.arm.master.sideBar.title": " Сухой мастер",
|
|
||||||
"dry-wash.arm.master.sideBar.title.master": "Мастера",
|
|
||||||
"dry-wash.arm.master.sideBar.title.orders": "Заказы"
|
|
||||||
|
|
||||||
}
|
|
1798
package-lock.json
generated
1798
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -17,7 +17,7 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@brojs/cli": "^1.6.1",
|
"@brojs/cli": "^1.3.0",
|
||||||
"@chakra-ui/icons": "^2.2.4",
|
"@chakra-ui/icons": "^2.2.4",
|
||||||
"@chakra-ui/react": "^2.4.2",
|
"@chakra-ui/react": "^2.4.2",
|
||||||
"@emotion/react": "^11.4.1",
|
"@emotion/react": "^11.4.1",
|
||||||
@ -26,7 +26,6 @@
|
|||||||
"@types/react": "^18.3.12",
|
"@types/react": "^18.3.12",
|
||||||
"express": "^4.21.1",
|
"express": "^4.21.1",
|
||||||
"framer-motion": "^6.2.8",
|
"framer-motion": "^6.2.8",
|
||||||
"i18next": "^23.16.4",
|
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-icons": "^5.3.0",
|
"react-icons": "^5.3.0",
|
||||||
|
@ -7,16 +7,15 @@ import {
|
|||||||
IconButton,
|
IconButton,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { EditIcon } from '@chakra-ui/icons';
|
import { EditIcon } from '@chakra-ui/icons';
|
||||||
import i18next from 'i18next';
|
|
||||||
|
|
||||||
const MasterActionsMenu = () => {
|
const MasterActionsMenu = () => {
|
||||||
return (
|
return (
|
||||||
<Menu>
|
<Menu>
|
||||||
<MenuButton icon={<EditIcon />} as={IconButton} variant='outline' />
|
<MenuButton icon={<EditIcon />} as={IconButton} variant='outline' />
|
||||||
<MenuList>
|
<MenuList>
|
||||||
<MenuItem>
|
<MenuItem>Посмотреть профиль</MenuItem>
|
||||||
{i18next.t('dry-wash.arm.master.table.actionsMenu.delete')}
|
<MenuItem>Изменить расписание</MenuItem>
|
||||||
</MenuItem>
|
<MenuItem>Удалить мастера</MenuItem>
|
||||||
</MenuList>
|
</MenuList>
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
|
@ -12,7 +12,6 @@ import {
|
|||||||
DrawerHeader,
|
DrawerHeader,
|
||||||
DrawerOverlay,
|
DrawerOverlay,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import i18next from 'i18next';
|
|
||||||
|
|
||||||
const MasterDrawer = ({ isOpen, onClose }) => {
|
const MasterDrawer = ({ isOpen, onClose }) => {
|
||||||
const [newMaster, setNewMaster] = useState({ name: '', phone: '' });
|
const [newMaster, setNewMaster] = useState({ name: '', phone: '' });
|
||||||
@ -27,46 +26,35 @@ const MasterDrawer = ({ isOpen, onClose }) => {
|
|||||||
<DrawerOverlay />
|
<DrawerOverlay />
|
||||||
<DrawerContent>
|
<DrawerContent>
|
||||||
<DrawerCloseButton />
|
<DrawerCloseButton />
|
||||||
<DrawerHeader>
|
<DrawerHeader>Добавить нового мастера</DrawerHeader>
|
||||||
{i18next.t('dry-wash.arm.master.drawer.title')}
|
|
||||||
</DrawerHeader>
|
|
||||||
<DrawerBody>
|
<DrawerBody>
|
||||||
<FormControl mb='4'>
|
<FormControl mb='4'>
|
||||||
<FormLabel>
|
<FormLabel>ФИО</FormLabel>
|
||||||
{i18next.t('dry-wash.arm.master.drawer.inputName.label')}
|
|
||||||
</FormLabel>
|
|
||||||
<Input
|
<Input
|
||||||
value={newMaster.name}
|
value={newMaster.name}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setNewMaster({ ...newMaster, name: e.target.value })
|
setNewMaster({ ...newMaster, name: e.target.value })
|
||||||
}
|
}
|
||||||
placeholder={i18next.t(
|
placeholder='Введите ФИО'
|
||||||
'dry-wash.arm.master.drawer.inputName.placeholder',
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<FormLabel>
|
<FormLabel>Номер телефона</FormLabel>
|
||||||
{' '}
|
|
||||||
{i18next.t('dry-wash.arm.master.drawer.inputPhone.label')}
|
|
||||||
</FormLabel>
|
|
||||||
<Input
|
<Input
|
||||||
value={newMaster.phone}
|
value={newMaster.phone}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setNewMaster({ ...newMaster, phone: e.target.value })
|
setNewMaster({ ...newMaster, phone: e.target.value })
|
||||||
}
|
}
|
||||||
placeholder={i18next.t(
|
placeholder='Введите номер телефона'
|
||||||
'dry-wash.arm.master.drawer.inputPhone.placeholder',
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</DrawerBody>
|
</DrawerBody>
|
||||||
<DrawerFooter>
|
<DrawerFooter>
|
||||||
<Button colorScheme='teal' mr={3} onClick={handleSave}>
|
<Button colorScheme='teal' mr={3} onClick={handleSave}>
|
||||||
{i18next.t('dry-wash.arm.master.drawer.button.save')}
|
Сохранить
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant='ghost' onClick={onClose}>
|
<Button variant='ghost' onClick={onClose}>
|
||||||
{i18next.t('dry-wash.arm.master.drawer.button.cancel')}
|
Отменить
|
||||||
</Button>
|
</Button>
|
||||||
</DrawerFooter>
|
</DrawerFooter>
|
||||||
</DrawerContent>
|
</DrawerContent>
|
@ -13,10 +13,9 @@ import {
|
|||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { mastersData } from '../../mocks';
|
import { mastersData } from '../../mocks';
|
||||||
import MasterItem from '../MasterItem';
|
import MasterItem from '../MasterItem';
|
||||||
import MasterDrawer from '../MasterDrawer';
|
import MasterDrawer from '../MasterModal';
|
||||||
import i18next from 'i18next';
|
|
||||||
|
|
||||||
const TABLE_HEADERS = ['name', 'currentJob', 'phone', 'actions'];
|
const TABLE_HEADERS = ['Имя', 'Актуальная занятость', 'Телефон', 'Действия'];
|
||||||
|
|
||||||
const Masters = () => {
|
const Masters = () => {
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||||
@ -24,18 +23,16 @@ const Masters = () => {
|
|||||||
return (
|
return (
|
||||||
<Box p='8'>
|
<Box p='8'>
|
||||||
<Flex justifyContent='space-between' alignItems='center' mb='5'>
|
<Flex justifyContent='space-between' alignItems='center' mb='5'>
|
||||||
<Heading size='lg'> {i18next.t('dry-wash.arm.master.title')}</Heading>
|
<Heading size='lg'>Мастера</Heading>
|
||||||
<Button colorScheme='green' onClick={onOpen}>
|
<Button colorScheme='green' onClick={onOpen}>
|
||||||
+ {i18next.t('dry-wash.arm.master.add')}
|
+ Добавить
|
||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Table variant='simple' colorScheme='blackAlpha'>
|
<Table variant='simple' colorScheme='blackAlpha'>
|
||||||
<Thead>
|
<Thead>
|
||||||
<Tr>
|
<Tr>
|
||||||
{TABLE_HEADERS.map((name) => (
|
{TABLE_HEADERS.map((name) => (
|
||||||
<Th key={name}>
|
<Th key={name}>{name}</Th>
|
||||||
{i18next.t(`dry-wash.arm.master.table.header.${name}`)}
|
|
||||||
</Th>
|
|
||||||
))}
|
))}
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Td, Tr, Link, Select } from '@chakra-ui/react';
|
import { Td, Tr, Link, Select } from '@chakra-ui/react';
|
||||||
import i18next from 'i18next';
|
|
||||||
|
|
||||||
const statuses = ['pending', 'progress', 'working', 'canceled', 'complete'];
|
|
||||||
|
|
||||||
const OrderItem = ({
|
const OrderItem = ({
|
||||||
carNumber,
|
carNumber,
|
||||||
@ -23,13 +20,13 @@ const OrderItem = ({
|
|||||||
<Select
|
<Select
|
||||||
value={statusSelect}
|
value={statusSelect}
|
||||||
onChange={(e) => setStatus(e.target.value)}
|
onChange={(e) => setStatus(e.target.value)}
|
||||||
placeholder={i18next.t(`dry-wash.arm.order.status.placeholder`)}
|
placeholder='Выберите статус'
|
||||||
>
|
>
|
||||||
{statuses.map((status) => (
|
<option value='в ожидании'>в ожидании</option>
|
||||||
<option key={status} value={status}>
|
<option value='В процессе'>в процессе</option>
|
||||||
{i18next.t(`dry-wash.arm.order.status.${status}`)}
|
<option value='в работе'>в работе</option>
|
||||||
</option>
|
<option value='отменил'>отменил</option>
|
||||||
))}
|
<option value='Завершено'>Завершено</option>
|
||||||
</Select>
|
</Select>
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
|
@ -2,28 +2,26 @@ import { Box, Heading, Table, Thead, Tbody, Tr, Th } from '@chakra-ui/react';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ordersData } from '../../mocks';
|
import { ordersData } from '../../mocks';
|
||||||
import OrderItem from '../OrderItem';
|
import OrderItem from '../OrderItem';
|
||||||
import i18next from 'i18next';
|
|
||||||
const Orders = () => {
|
const Orders = () => {
|
||||||
const TABLE_HEADERS = [
|
const TABLE_HEADERS = [
|
||||||
'carNumber',
|
'Номер машины',
|
||||||
'washingTime',
|
'Время мойки',
|
||||||
'orderDate',
|
'Дата заказа',
|
||||||
'status',
|
'Статус',
|
||||||
'telephone',
|
'Телефон',
|
||||||
'location',
|
'Расположение',
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<Box p='8'>
|
<Box p='8'>
|
||||||
<Heading size='lg' mb='5'>
|
<Heading size='lg' mb='5'>
|
||||||
{i18next.t('dry-wash.arm.order.title')}
|
Заказы
|
||||||
</Heading>
|
</Heading>
|
||||||
<Table variant='simple' colorScheme='blackAlpha'>
|
<Table variant='simple' colorScheme='blackAlpha'>
|
||||||
<Thead>
|
<Thead>
|
||||||
<Tr>
|
<Tr>
|
||||||
{TABLE_HEADERS.map((name, key) => (
|
{TABLE_HEADERS.map((name, key) => (
|
||||||
<Th key={key}>
|
<Th key={key}>{name}</Th>
|
||||||
{i18next.t(`dry-wash.arm.order.table.header.${name}`)}
|
|
||||||
</Th>
|
|
||||||
))}
|
))}
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Box, Button, Heading, VStack } from '@chakra-ui/react';
|
import { Box, Button, Heading, VStack } from '@chakra-ui/react';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Divider } from '@chakra-ui/react';
|
import { Divider } from '@chakra-ui/react';
|
||||||
import i18next from 'i18next';
|
|
||||||
const Sidebar = ({ onSelectPage }) => (
|
const Sidebar = ({ onSelectPage }) => (
|
||||||
<Box
|
<Box
|
||||||
borderRight='1px solid black'
|
borderRight='1px solid black'
|
||||||
@ -12,7 +12,7 @@ const Sidebar = ({ onSelectPage }) => (
|
|||||||
pt='8'
|
pt='8'
|
||||||
>
|
>
|
||||||
<Heading color='green' size='lg' mb='5'>
|
<Heading color='green' size='lg' mb='5'>
|
||||||
{i18next.t(`dry-wash.arm.master.sideBar.title`)}
|
Сухой мастер
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
<VStack align='start' spacing='4'>
|
<VStack align='start' spacing='4'>
|
||||||
@ -23,7 +23,7 @@ const Sidebar = ({ onSelectPage }) => (
|
|||||||
colorScheme='green'
|
colorScheme='green'
|
||||||
variant='ghost'
|
variant='ghost'
|
||||||
>
|
>
|
||||||
{i18next.t(`dry-wash.arm.master.sideBar.title.orders`)}
|
Заказы
|
||||||
</Button>
|
</Button>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Button
|
<Button
|
||||||
@ -32,7 +32,7 @@ const Sidebar = ({ onSelectPage }) => (
|
|||||||
colorScheme='green'
|
colorScheme='green'
|
||||||
variant='ghost'
|
variant='ghost'
|
||||||
>
|
>
|
||||||
{i18next.t(`dry-wash.arm.master.sideBar.title.master`)}
|
Мастера
|
||||||
</Button>
|
</Button>
|
||||||
<Divider />
|
<Divider />
|
||||||
</VStack>
|
</VStack>
|
||||||
|
@ -1,26 +1,19 @@
|
|||||||
|
|
||||||
/* eslint-disable react/display-name */
|
/* eslint-disable react/display-name */
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom/client';
|
import ReactDOM from 'react-dom/client';
|
||||||
import { i18nextReactInitConfig } from '@brojs/cli';
|
|
||||||
import App from './app';
|
|
||||||
import i18next from 'i18next';
|
|
||||||
|
|
||||||
i18next.t = i18next.t.bind(i18next);
|
import App from './app';
|
||||||
const i18nextPromise = i18nextReactInitConfig(i18next);
|
|
||||||
export default () => <App />;
|
export default () => <App />;
|
||||||
|
|
||||||
let rootElement: ReactDOM.Root;
|
let rootElement: ReactDOM.Root;
|
||||||
|
|
||||||
export const mount = async (
|
export const mount = (Component, element = document.getElementById('app')) => {
|
||||||
Component,
|
|
||||||
element = document.getElementById('app'),
|
|
||||||
) => {
|
|
||||||
const rootElement = ReactDOM.createRoot(element);
|
const rootElement = ReactDOM.createRoot(element);
|
||||||
await i18nextPromise;
|
|
||||||
rootElement.render(<Component />);
|
rootElement.render(<Component />);
|
||||||
if (module.hot) {
|
if (module.hot) {
|
||||||
module.hot.accept('./app', async () => {
|
module.hot.accept('./app', () => {
|
||||||
await i18next.reloadResources();
|
|
||||||
rootElement.render(<Component />);
|
rootElement.render(<Component />);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user