feat: add dynamic routing (#25)
Some checks failed
it-academy/dry-wash-pl/pipeline/pr-main There was a failure building this commit
it-academy/dry-wash-pl/pipeline/head There was a failure building this commit

This commit is contained in:
2024-11-24 14:50:51 +03:00
parent c2fad8a3ff
commit dee3a04310
5 changed files with 89 additions and 52 deletions

View File

@@ -2,6 +2,7 @@ import { Box, Button, Heading, VStack, Divider } from '@chakra-ui/react';
import React from 'react';
import { Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { URLs } from '../../__data__/urls';
const Sidebar = () => {
const { t } = useTranslation('~', {
@@ -23,25 +24,29 @@ const Sidebar = () => {
<VStack align='start' spacing='4'>
<Divider />
<Button
as={Link}
to='orders'
w='100%'
colorScheme='green'
variant='ghost'
>
{t('orders')}
</Button>
{URLs.armOrder.isOn && (
<Button
as={Link}
to={URLs.armOrder.url}
w='100%'
colorScheme='green'
variant='ghost'
>
{t('orders')}
</Button>
)}
<Divider />
<Button
as={Link}
to='masters'
w='100%'
colorScheme='green'
variant='ghost'
>
{t('master')}
</Button>
{URLs.armMaster.isOn && (
<Button
as={Link}
to={URLs.armMaster.url}
w='100%'
colorScheme='green'
variant='ghost'
>
{t('master')}
</Button>
)}
<Divider />
</VStack>
</Box>