feat: add router to the arm page (#14)

This commit is contained in:
2024-11-09 19:34:12 +03:00
parent e4969938c3
commit 04e4d011ff
4 changed files with 26 additions and 25 deletions

View File

@@ -2,7 +2,9 @@ import { Box, Button, Heading, VStack } from '@chakra-ui/react';
import React from 'react';
import { Divider } from '@chakra-ui/react';
import i18next from 'i18next';
const Sidebar = ({ onSelectPage }) => (
import { Link } from 'react-router-dom';
const Sidebar = () => (
<Box
borderRight='1px solid black'
bg='gray.50'
@@ -17,23 +19,17 @@ const Sidebar = ({ onSelectPage }) => (
<VStack align='start' spacing='4'>
<Divider />
<Button
onClick={() => onSelectPage('orders')}
w='100%'
colorScheme='green'
variant='ghost'
>
{i18next.t(`dry-wash.arm.master.sideBar.title.orders`)}
</Button>
<Link to='orders'>
<Button w='100%' colorScheme='green' variant='ghost'>
{i18next.t(`dry-wash.arm.master.sideBar.title.orders`)}
</Button>
</Link>
<Divider />
<Button
onClick={() => onSelectPage('masters')}
w='100%'
colorScheme='green'
variant='ghost'
>
{i18next.t(`dry-wash.arm.master.sideBar.title.master`)}
</Button>
<Link to='masters'>
<Button w='100%' colorScheme='green' variant='ghost'>
{i18next.t(`dry-wash.arm.master.sideBar.title.master`)}
</Button>
</Link>
<Divider />
</VStack>
</Box>