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
51 lines (49 loc) · 1.14 KB
/
Navigation.js
File metadata and controls
51 lines (49 loc) · 1.14 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
import React from 'react'
import { Link as ReactRouterLink } from 'react-router-dom'
import { Flex, Stack } from '@chakra-ui/core'
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={15.5}
color="primary"
borderBottom="2px solid"
borderBottomColor="gray.300"
{...props}
>
<Flex
maxW={{ sm: 540, md: 768, lg: 960, xl: 1200 }}
mx="auto"
px={4}
w="100%"
align="center"
direction="row"
>
<Stack
isInline
alignItems="center"
flexWrap="wrap"
spacing="6"
w="100%"
>
{React.Children.map(children, child => {
if (child !== null) {
return React.cloneElement(child, {
as: ReactRouterLink,
})
}
})}
</Stack>
</Flex>
</Flex>
)
}
Navigation.propTypes = {
children: node,
}