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
44 lines (42 loc) · 1.02 KB
/
Navigation.js
File metadata and controls
44 lines (42 loc) · 1.02 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
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"
align="center"
justify="space-between"
wrap="wrap"
padding={{ sm: '0.6rem', md: '0.80rem', lg: '1rem', xl: '1rem' }}
bg="#fff"
py="4px"
color="primary"
borderBottom="2px solid"
borderBottomColor="gray.300"
display={{ base: 'none', md: 'flex' }}
{...props}
>
<Stack
layerStyle="pageLayout"
isInline
alignItems="center"
flexWrap="wrap"
spacing={{ md: 4, lg: 6 }}
px={4}
>
{React.Children.map(children, (child) => {
if (child !== null) {
return React.cloneElement(child, {
as: ReactRouterLink,
})
}
})}
</Stack>
</Flex>
)
}
Navigation.propTypes = {
children: node,
}