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';
|
2021-04-10 11:17:58 -07:00
|
|
|
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';
|
2020-11-29 01:25:48 -07:00
|
|
|
|
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' },
|
|
|
|
|
});
|
2020-11-29 01:25:48 -07:00
|
|
|
|
2021-12-18 00:29:51 -07:00
|
|
|
export const Header = (): JSX.Element => {
|
|
|
|
|
const formInteractive = useFormInteractive();
|
2020-11-29 01:25:48 -07:00
|
|
|
|
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-11-29 01:25:48 -07:00
|
|
|
);
|
2020-12-11 09:55:21 -07:00
|
|
|
|
2020-12-29 02:05:28 -07:00
|
|
|
const justify = useBreakpointValue({ base: 'flex-start', lg: 'center' });
|
2020-11-29 01:25:48 -07:00
|
|
|
|
|
|
|
|
return (
|
2021-12-18 00:29:51 -07:00
|
|
|
<Wrapper layout="position">
|
2020-12-29 15:58:36 -07:00
|
|
|
<ScaleFade in initialScale={0.5} style={{ width: '100%' }}>
|
2021-12-18 00:29:51 -07:00
|
|
|
<Flex
|
2020-12-29 15:58:36 -07:00
|
|
|
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
|
|
|
>
|
2020-12-29 15:58:36 -07:00
|
|
|
<Title />
|
2021-12-18 00:29:51 -07:00
|
|
|
</Flex>
|
2020-12-29 15:58:36 -07:00
|
|
|
</ScaleFade>
|
2021-12-18 00:29:51 -07:00
|
|
|
</Wrapper>
|
2020-11-29 01:25:48 -07:00
|
|
|
);
|
|
|
|
|
};
|