forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFooter.js
More file actions
55 lines (51 loc) · 1.37 KB
/
Footer.js
File metadata and controls
55 lines (51 loc) · 1.37 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
import React from 'react'
import PropTypes from 'prop-types'
import { useLingui } from '@lingui/react'
import wordmark from './images/canada-wordmark.svg'
import { Box, Flex, Image, List, ListItem } from '@chakra-ui/core'
export const Footer = (props) => {
const { i18n } = useLingui()
const smallDevice = window.matchMedia('(max-width: 500px)').matches
return (
<Flex
{...props}
py="4"
fontFamily="body"
borderTop="2px solid"
borderTopColor="gray.300"
>
<Flex
maxW={{ sm: 540, md: 768, lg: 960, xl: 1200 }}
mx="auto"
px={4}
w="100%"
align="center"
direction="row"
>
<List px={0} d="flex" align="center" direction="row">
{React.Children.map(props.children, (child) => (
<ListItem>{child}</ListItem>
))}
</List>
{!smallDevice && (
<Box py={4} width={{ base: 147.2 }} ml="auto">
<Image
src={wordmark}
width="100%"
alt={
i18n.locale === 'en'
? 'Symbol of the Government of Canada'
: 'Symbole du gouvernement du Canada'
}
/>
</Box>
)}
</Flex>
</Flex>
)
}
Footer.propTypes = {
children: PropTypes.any,
bg: PropTypes.string,
}
Footer.defaultProps = { bg: 'gray.200' }