1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00
Files
checktheroads-hyperglass/hyperglass/ui/components/header/header.tsx

38 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-12-29 02:05:28 -07:00
import { Flex, ScaleFade } from '@chakra-ui/react';
2021-12-18 00:29:51 -07:00
import { motionChakra } from '~/components';
import { useBreakpointValue } from '~/context';
2021-12-18 00:29:51 -07:00
import { useBooleanValue, useFormInteractive } from '~/hooks';
2020-12-29 02:05:28 -07:00
import { Title } from './title';
2021-12-18 00:29:51 -07:00
const Wrapper = motionChakra('header', {
baseStyle: { display: 'flex', px: 4, pt: 6, minH: 16, w: 'full', flex: '0 1 auto' },
});
2021-12-18 00:29:51 -07:00
export const Header = (): JSX.Element => {
const formInteractive = useFormInteractive();
2020-12-29 02:05:28 -07:00
const titleWidth = useBooleanValue(
2021-12-18 00:29:51 -07:00
formInteractive,
2020-12-29 02:05:28 -07:00
{ base: '75%', lg: '50%' },
{ base: '75%', lg: '75%' },
);
2020-12-29 02:05:28 -07:00
const justify = useBreakpointValue({ base: 'flex-start', lg: 'center' });
return (
2021-12-18 00:29:51 -07:00
<Wrapper layout="position">
<ScaleFade in initialScale={0.5} style={{ width: '100%' }}>
2021-12-18 00:29:51 -07:00
<Flex
height="100%"
maxW={titleWidth}
// This is here for the logo
justifyContent={justify}
2021-12-18 00:29:51 -07:00
mx={{ base: formInteractive ? 'auto' : 0, lg: 'auto' }}
2021-01-03 23:51:09 -07:00
>
<Title />
2021-12-18 00:29:51 -07:00
</Flex>
</ScaleFade>
2021-12-18 00:29:51 -07:00
</Wrapper>
);
};