forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNavigation.js
More file actions
40 lines (38 loc) · 958 Bytes
/
Navigation.js
File metadata and controls
40 lines (38 loc) · 958 Bytes
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
import React from 'react'
import { Link as ReactRouterLink } from 'react-router-dom'
import { Flex, Stack } from '@chakra-ui/react'
import { node } from 'prop-types'
export const Navigation = ({ children, ...props }) => {
return (
<Flex
as="nav"
padding={{ sm: '0.6rem', md: '0.80rem', lg: '1rem', xl: '1rem' }}
color="primary"
borderBottom="2px solid"
borderBottomColor="black"
display={{ base: 'none', md: 'flex' }}
mx="12"
{...props}
>
<Stack
ml="auto"
isInline
alignItems="center"
flexWrap="wrap"
spacing={{ md: '4', lg: '6' }}
fontWeight="semibold"
>
{React.Children.map(children, (child) => {
if (child !== null) {
return React.cloneElement(child, {
as: ReactRouterLink,
})
}
})}
</Stack>
</Flex>
)
}
Navigation.propTypes = {
children: node,
}