Compare commits
20 Commits
0b47fb4a2a
...
feature/pa
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d208b1fc5 | |||
| 1839136c9f | |||
| a6ec94785a | |||
| 18ca96bfe9 | |||
| db918ba7c7 | |||
| d1d92c63e8 | |||
| dedc7e1608 | |||
| 1c8348dee5 | |||
| 04e4d011ff | |||
| e4969938c3 | |||
| 5fa37ad2db | |||
| d7da2b5618 | |||
| 413181617b | |||
|
|
10854c836b | ||
|
|
98e11704e6 | ||
|
|
1d8e9c7e90 | ||
|
|
1930333d64 | ||
| 116e883e91 | |||
| 9b3a204657 | |||
| 9a490bd993 |
0
Jenkinsfile.txt → Jenkinsfile
vendored
0
Jenkinsfile.txt → Jenkinsfile
vendored
38
locales/ru.json
Normal file
38
locales/ru.json
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"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": "Заказы",
|
||||||
|
"dry-wash.notFound.title": "Страница не найдена",
|
||||||
|
"dry-wash.notFound.description": "К сожалению, запрашиваемая вами страница не существует.",
|
||||||
|
"dry-wash.notFound.button.back": " Вернуться на главную",
|
||||||
|
"dry-wash.errorBoundary.title":"Что-то пошло не так",
|
||||||
|
"dry-wash.errorBoundary.description": " Мы уже работаем над исправлением проблемы",
|
||||||
|
"dry-wash.errorBoundary.button.reload": "Перезагрузить страницу"
|
||||||
|
}
|
||||||
1821
package-lock.json
generated
1821
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -17,15 +17,17 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@brojs/cli": "^1.3.0",
|
"@brojs/cli": "^1.6.1",
|
||||||
"@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",
|
||||||
"@emotion/styled": "^11.3.0",
|
"@emotion/styled": "^11.3.0",
|
||||||
"@fontsource/open-sans": "^5.1.0",
|
"@fontsource/open-sans": "^5.1.0",
|
||||||
|
"@lottiefiles/react-lottie-player": "^3.5.4",
|
||||||
"@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",
|
||||||
|
|||||||
@@ -2,13 +2,16 @@ import React from 'react';
|
|||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
import Routers from './routes';
|
import Routers from './routes';
|
||||||
import { ChakraProvider, theme as chakraTheme } from '@chakra-ui/react';
|
import { ChakraProvider, theme as chakraTheme } from '@chakra-ui/react';
|
||||||
|
import ErrorBoundary from './components/ErrorBoundary';
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
return (
|
return (
|
||||||
<ChakraProvider theme={chakraTheme}>
|
<ChakraProvider theme={chakraTheme}>
|
||||||
|
<ErrorBoundary>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Routers></Routers>
|
<Routers />
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
|
</ErrorBoundary>
|
||||||
</ChakraProvider>
|
</ChakraProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
1
src/assets/animation/notFound.json
Normal file
1
src/assets/animation/notFound.json
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
|||||||
export { default as DemoVideo } from './demo.mp4';
|
|
||||||
64
src/components/ErrorBoundary/ErrorBoundary.tsx
Normal file
64
src/components/ErrorBoundary/ErrorBoundary.tsx
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import React, { Component, ErrorInfo, ReactNode } from 'react';
|
||||||
|
import { Heading, Text, Button, Center, VStack } from '@chakra-ui/react';
|
||||||
|
import i18next from 'i18next';
|
||||||
|
|
||||||
|
interface ErrorBoundaryState {
|
||||||
|
hasError: boolean;
|
||||||
|
error: Error | null;
|
||||||
|
errorInfo: ErrorInfo | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ErrorBoundaryProps {
|
||||||
|
children: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
||||||
|
constructor(props: ErrorBoundaryProps) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
hasError: false,
|
||||||
|
error: null,
|
||||||
|
errorInfo: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static getDerivedStateFromError(): Partial<ErrorBoundaryState> {
|
||||||
|
return { hasError: true };
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void {
|
||||||
|
console.error('Error caught by ErrorBoundary:', error, errorInfo);
|
||||||
|
this.setState({ error, errorInfo });
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { hasError } = this.state;
|
||||||
|
//TODO: добавить анимацию после залива 404 страницы
|
||||||
|
if (hasError) {
|
||||||
|
return (
|
||||||
|
<Center minH='100vh'>
|
||||||
|
<VStack spacing={4} textAlign='center'>
|
||||||
|
<Heading as='h1' size='2xl'>
|
||||||
|
{i18next.t('dry-wash.errorBoundary.title')}
|
||||||
|
</Heading>
|
||||||
|
<Text fontSize='lg'>
|
||||||
|
{i18next.t('dry-wash.errorBoundary.description')}
|
||||||
|
</Text>
|
||||||
|
<Button
|
||||||
|
colorScheme='teal'
|
||||||
|
size='lg'
|
||||||
|
variant='outline'
|
||||||
|
onClick={() => window.location.reload()}
|
||||||
|
>
|
||||||
|
{i18next.t('dry-wash.errorBoundary.button.reload')}
|
||||||
|
</Button>
|
||||||
|
</VStack>
|
||||||
|
</Center>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.props.children;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ErrorBoundary;
|
||||||
1
src/components/ErrorBoundary/index.ts
Normal file
1
src/components/ErrorBoundary/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './ErrorBoundary';
|
||||||
@@ -3,13 +3,19 @@ import Sidebar from '../Sidebar';
|
|||||||
import Orders from '../Orders';
|
import Orders from '../Orders';
|
||||||
import Masters from '../Masters';
|
import Masters from '../Masters';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||||
|
|
||||||
const LayoutArm = ({ currentPage, onSelectPage }) => (
|
const LayoutArm = () => (
|
||||||
<Flex h='100vh'>
|
<Flex h='100vh'>
|
||||||
<Sidebar onSelectPage={onSelectPage} />
|
<Sidebar />
|
||||||
<Box flex='1' bg='gray.50'>
|
<Box flex='1' bg='gray.50'>
|
||||||
{currentPage === 'orders' && <Orders />}
|
<Routes>
|
||||||
{currentPage === 'masters' && <Masters />}
|
<Route>
|
||||||
|
<Route index element={<Navigate to='orders' replace />} />
|
||||||
|
<Route path='orders' element={<Orders />} />
|
||||||
|
<Route path='masters' element={<Masters />} />
|
||||||
|
</Route>
|
||||||
|
</Routes>
|
||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,15 +7,16 @@ 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>
|
||||||
<MenuItem>Изменить расписание</MenuItem>
|
{i18next.t('dry-wash.arm.master.table.actionsMenu.delete')}
|
||||||
<MenuItem>Удалить мастера</MenuItem>
|
</MenuItem>
|
||||||
</MenuList>
|
</MenuList>
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ 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: '' });
|
||||||
@@ -26,35 +27,46 @@ 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='Введите ФИО'
|
placeholder={i18next.t(
|
||||||
|
'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='Введите номер телефона'
|
placeholder={i18next.t(
|
||||||
|
'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,9 +13,10 @@ 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 '../MasterModal';
|
import MasterDrawer from '../MasterDrawer';
|
||||||
|
import i18next from 'i18next';
|
||||||
|
|
||||||
const TABLE_HEADERS = ['Имя', 'Актуальная занятость', 'Телефон', 'Действия'];
|
const TABLE_HEADERS = ['name', 'currentJob', 'phone', 'actions'];
|
||||||
|
|
||||||
const Masters = () => {
|
const Masters = () => {
|
||||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||||
@@ -23,16 +24,18 @@ 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'>Мастера</Heading>
|
<Heading size='lg'> {i18next.t('dry-wash.arm.master.title')}</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}>{name}</Th>
|
<Th key={name}>
|
||||||
|
{i18next.t(`dry-wash.arm.master.table.header.${name}`)}
|
||||||
|
</Th>
|
||||||
))}
|
))}
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
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,
|
||||||
@@ -20,13 +23,13 @@ const OrderItem = ({
|
|||||||
<Select
|
<Select
|
||||||
value={statusSelect}
|
value={statusSelect}
|
||||||
onChange={(e) => setStatus(e.target.value)}
|
onChange={(e) => setStatus(e.target.value)}
|
||||||
placeholder='Выберите статус'
|
placeholder={i18next.t(`dry-wash.arm.order.status.placeholder`)}
|
||||||
>
|
>
|
||||||
<option value='в ожидании'>в ожидании</option>
|
{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>
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Td>
|
</Td>
|
||||||
<Td>
|
<Td>
|
||||||
|
|||||||
@@ -2,26 +2,28 @@ 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}>{name}</Th>
|
<Th key={key}>
|
||||||
|
{i18next.t(`dry-wash.arm.order.table.header.${name}`)}
|
||||||
|
</Th>
|
||||||
))}
|
))}
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
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';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
const Sidebar = ({ onSelectPage }) => (
|
const Sidebar = () => (
|
||||||
<Box
|
<Box
|
||||||
borderRight='1px solid black'
|
borderRight='1px solid black'
|
||||||
bg='gray.50'
|
bg='gray.50'
|
||||||
@@ -12,27 +14,29 @@ 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'>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Button
|
<Button
|
||||||
onClick={() => onSelectPage('orders')}
|
as={Link}
|
||||||
|
to='orders'
|
||||||
w='100%'
|
w='100%'
|
||||||
colorScheme='green'
|
colorScheme='green'
|
||||||
variant='ghost'
|
variant='ghost'
|
||||||
>
|
>
|
||||||
Заказы
|
{i18next.t(`dry-wash.arm.master.sideBar.title.orders`)}
|
||||||
</Button>
|
</Button>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Button
|
<Button
|
||||||
onClick={() => onSelectPage('masters')}
|
as={Link}
|
||||||
|
to='masters'
|
||||||
w='100%'
|
w='100%'
|
||||||
colorScheme='green'
|
colorScheme='green'
|
||||||
variant='ghost'
|
variant='ghost'
|
||||||
>
|
>
|
||||||
Мастера
|
{i18next.t(`dry-wash.arm.master.sideBar.title.master`)}
|
||||||
</Button>
|
</Button>
|
||||||
<Divider />
|
<Divider />
|
||||||
</VStack>
|
</VStack>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, { FC } from 'react';
|
import React, { FC } from 'react';
|
||||||
import { Box, Heading, Text, Center, VStack, BoxProps } from '@chakra-ui/react';
|
import { Box, Heading, Text, Center, VStack, BoxProps } from '@chakra-ui/react';
|
||||||
import { DemoVideo } from '../../../assets/videos';
|
|
||||||
import { DemoVideoPosterImg } from '../../../assets/images';
|
import { DemoVideoPosterImg } from '../../../assets/images';
|
||||||
import { CtaButton, SiteLogo, PageSection } from '../';
|
import { CtaButton, SiteLogo, PageSection } from '../';
|
||||||
|
|
||||||
@@ -11,7 +10,7 @@ export const HeroSection: FC<HeroSectionProps> = ({ flexShrink }) => {
|
|||||||
<Box flexShrink={flexShrink} as='header' pos='relative' zIndex={0}>
|
<Box flexShrink={flexShrink} as='header' pos='relative' zIndex={0}>
|
||||||
<Box
|
<Box
|
||||||
as='video'
|
as='video'
|
||||||
src={DemoVideo}
|
src={`${__webpack_public_path__}/remote-assets/demo.mp4`}
|
||||||
poster={DemoVideoPosterImg}
|
poster={DemoVideoPosterImg}
|
||||||
autoPlay
|
autoPlay
|
||||||
loop
|
loop
|
||||||
|
|||||||
@@ -1,19 +1,26 @@
|
|||||||
|
|
||||||
/* 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 App from './app';
|
||||||
|
import i18next from 'i18next';
|
||||||
|
|
||||||
|
i18next.t = i18next.t.bind(i18next);
|
||||||
|
const i18nextPromise = i18nextReactInitConfig(i18next);
|
||||||
export default () => <App />;
|
export default () => <App />;
|
||||||
|
|
||||||
let rootElement: ReactDOM.Root;
|
let rootElement: ReactDOM.Root;
|
||||||
|
|
||||||
export const mount = (Component, element = document.getElementById('app')) => {
|
export const mount = async (
|
||||||
|
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', () => {
|
module.hot.accept('./app', async () => {
|
||||||
|
await i18next.reloadResources();
|
||||||
rootElement.render(<Component />);
|
rootElement.render(<Component />);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ import React, { useState } from 'react';
|
|||||||
import LayoutArm from '../../components/LayoutArm';
|
import LayoutArm from '../../components/LayoutArm';
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
const [currentPage, setCurrentPage] = useState('orders');
|
return <LayoutArm />;
|
||||||
|
|
||||||
return <LayoutArm currentPage={currentPage} onSelectPage={setCurrentPage} />;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
43
src/pages/notFound/notFound.tsx
Normal file
43
src/pages/notFound/notFound.tsx
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Text, Button, Center, VStack, Heading } from '@chakra-ui/react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import { Player } from '@lottiefiles/react-lottie-player';
|
||||||
|
import animate from '../../assets/animation/notFound.json';
|
||||||
|
import i18next from 'i18next';
|
||||||
|
|
||||||
|
const NotFound = () => {
|
||||||
|
return (
|
||||||
|
<Center minH='100vh'>
|
||||||
|
<VStack spacing={4} textAlign='center'>
|
||||||
|
<Player
|
||||||
|
autoplay
|
||||||
|
loop
|
||||||
|
src={animate}
|
||||||
|
style={{
|
||||||
|
height: '100%',
|
||||||
|
width: '100%',
|
||||||
|
maxHeight: '450px',
|
||||||
|
maxWidth: '450px',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Heading fontSize='xl'>
|
||||||
|
{i18next.t(`dry-wash.arm.notFound.title`)}
|
||||||
|
</Heading>
|
||||||
|
<Text fontSize='lg'>
|
||||||
|
{i18next.t(`dry-wash.arm.notFound.description`)}
|
||||||
|
</Text>
|
||||||
|
<Button
|
||||||
|
as={Link}
|
||||||
|
to='/dry-wash'
|
||||||
|
colorScheme='teal'
|
||||||
|
size='lg'
|
||||||
|
variant='outline'
|
||||||
|
>
|
||||||
|
{i18next.t(`dry-wash.arm.notFound.button.back`)}
|
||||||
|
</Button>
|
||||||
|
</VStack>
|
||||||
|
</Center>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NotFound;
|
||||||
@@ -2,6 +2,7 @@ import React, { lazy, Suspense } from 'react';
|
|||||||
import { Routes, Route } from 'react-router-dom';
|
import { Routes, Route } from 'react-router-dom';
|
||||||
import { PageSpinner } from './components';
|
import { PageSpinner } from './components';
|
||||||
import Arm from './pages/arm';
|
import Arm from './pages/arm';
|
||||||
|
import NotFound from './pages/notFound/notFound';
|
||||||
|
|
||||||
const Landing = lazy(() => import('./pages/landing'));
|
const Landing = lazy(() => import('./pages/landing'));
|
||||||
const OrderForm = lazy(() => import('./pages/order-form'));
|
const OrderForm = lazy(() => import('./pages/order-form'));
|
||||||
@@ -16,7 +17,8 @@ const Routers = () => {
|
|||||||
<Route path='order-form' element={<OrderForm />} />
|
<Route path='order-form' element={<OrderForm />} />
|
||||||
<Route path='order-view' element={<OrderView />} />
|
<Route path='order-view' element={<OrderView />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path='/dry-wash/arm' element={<Arm />}></Route>
|
<Route path='/dry-wash/arm/*' element={<Arm />}></Route>
|
||||||
|
<Route path='*' element={<NotFound />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
);
|
);
|
||||||
|
|||||||
5
types.d.ts
vendored
5
types.d.ts
vendored
@@ -16,7 +16,4 @@ declare module "*.webp" {
|
|||||||
export = value;
|
export = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '*.mp4' {
|
declare const __webpack_public_path__: string;
|
||||||
const src: string;
|
|
||||||
export default src;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user