feat: change sidebar to header, fix wizard update, delete unnecessary statuses
Some checks failed
it-academy/dry-wash-pl/pipeline/head There was a failure building this commit
it-academy/dry-wash-pl/pipeline/pr-main This commit looks good

This commit is contained in:
2025-02-24 23:07:10 +03:00
parent c9c17340c6
commit d312445bf2
12 changed files with 111 additions and 83 deletions

View File

@@ -0,0 +1,51 @@
import { Box, Button, Heading, HStack, Divider, Flex } from '@chakra-ui/react';
import React from 'react';
import { useLocation, Link } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { URLs } from '../../__data__/urls';
const Header = () => {
const location = useLocation();
const isActive = (keyword: string) => location.pathname.includes(keyword);
const { t } = useTranslation('~', {
keyPrefix: 'dry-wash.arm.master.sideBar',
});
return (
<Box as='header' bg='gray.50' boxShadow='md' px={6} py={4} w='100%'>
<Flex gap={50} align='center'>
<Heading color='green' size='lg'>
{t('title')}
</Heading>
<HStack spacing={4}>
{URLs.armOrder.isOn && (
<Button
as={Link}
to={URLs.armOrder.url}
colorScheme={isActive(URLs.armOrder.url) ? 'green' : 'blue'}
variant={isActive(URLs.armOrder.url) ? 'outline' : 'ghost'}
>
{t('orders')}
</Button>
)}
<Divider orientation='vertical' height='30px' />
{URLs.armMaster.isOn && (
<Button
as={Link}
to={URLs.armMaster.url}
colorScheme={isActive(URLs.armMaster.url) ? 'green' : 'blue'}
variant={isActive(URLs.armMaster.url) ? 'outline' : 'ghost'}
data-testid='master-button'
>
{t('master')}
</Button>
)}
</HStack>
</Flex>
</Box>
);
};
export default Header;

View File

@@ -0,0 +1 @@
export { default } from './Header';