-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathheader.js
More file actions
104 lines (99 loc) · 2.91 KB
/
header.js
File metadata and controls
104 lines (99 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import { DesktopNav } from '@/components/desktop-nav'
import { Link } from '@/components/mdx'
import { MobileNav } from '@/components/mobile-nav'
import { menuItems } from '@/data/menu-items'
import { CloseIcon, HamburgerIcon } from '@chakra-ui/icons'
import {
Box,
Container,
Flex,
IconButton,
Image,
Stack,
useColorMode,
useColorModeValue,
useDisclosure,
} from '@chakra-ui/react'
import { ColorModeImage } from '@/components/ColorModeImage'
import React from 'react'
export const Header = () => {
const navItems = React.useMemo(() => menuItems, [])
const { isOpen, onToggle } = useDisclosure()
const { colorMode, toggleColorMode } = useColorMode()
return (
<Box>
<Flex
as={'header'}
pos='fixed'
top={'0'}
w={'full'}
minH={'60px'}
boxShadow={'sm'}
zIndex={'999'}
justify={'center'}
css={{
backdropFilter: 'saturate(180%) blur(5px)',
backgroundColor: useColorModeValue(
'rgba(255, 255, 255, 0.8)',
'rgba(26, 32, 44, 0.8)',
),
}}
>
<Container as={Flex} maxW={'container.lg'} align={'center'}>
<Flex
flex={{ base: '0', md: 'auto' }}
ml={{ base: -2 }}
mr={{ base: 6, md: 0 }}
display={{ base: 'flex', md: 'none' }}
>
<IconButton
onClick={onToggle}
icon={
isOpen ? (
<CloseIcon w={3} h={3} />
) : (
<HamburgerIcon w={5} h={5} />
)
}
variant={'ghost'}
size={'sm'}
aria-label={'Toggle Navigation'}
/>
</Flex>
<Flex
flex={{ base: 1, md: 'auto' }}
justify={{ base: 'start', md: 'start' }}
>
<Stack
as={Link}
href={'/'}
direction={'row'}
alignItems={'center'}
spacing={{ base: 2, sm: 4 }}
>
<ColorModeImage
w={48}
lightSrc={'/parcels-assets/logo-horo.svg'} //TODO: Update to svg in roughly 1h*3w (internal) and 1h*2w external (as was before)
darkSrc={'/parcels-assets/logo-horo_dia.svg'} //TODO: Update to svg in roughly 1h*3w (internal) and 1h*2w external (as was before)
alt={'parcels logo'}
/>
</Stack>
</Flex>
<Stack
direction={'row'}
align={'center'}
spacing={{ base: 6, md: 8 }}
flex={{ base: 1, md: 'auto' }}
justify={'flex-end'}
>
<DesktopNav
navItems={navItems}
display={{ base: 'none', md: 'flex' }}
/>
</Stack>
</Container>
</Flex>
<MobileNav isOpen={isOpen} navItems={navItems} />
</Box>
)
}