Skip to content

Commit 9a10ac5

Browse files
committed
added mobile navbar
1 parent fe347a4 commit 9a10ac5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/components/nav.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react'
2-
import { Box, Flex, PseudoBox } from '@chakra-ui/core'
2+
import { Box, Flex, PseudoBox, Icon } from '@chakra-ui/core'
33
import Link from './link'
44

55
// TODO: mobile nav fix
@@ -40,7 +40,7 @@ const Nav = ({ logo, links,}) => {
4040
))}
4141
</Flex>
4242
<Box display={['block', 'none']} p={1} onClick={() => setIsOpen(!isOpen)}>
43-
<Box height='3px' bg='primary' marginBottom='5px' width={'30px'}/>
43+
<Box height='3px' bg='primary' marginBottom='5px' width={'25px'}/>
4444
<Box height='3px' bg='primary' marginBottom='5px'/>
4545
<Box height='3px' bg='primary' marginBottom='5px'/>
4646
</Box>
@@ -53,16 +53,22 @@ const Nav = ({ logo, links,}) => {
5353
left='0'
5454
bg='secondary'
5555
flexDirection='column'
56-
justify='space-between'
5756
align='center'
57+
zIndex='5'
5858
>
59+
<Flex p='2' justifyContent='flex-end' width='100%'>
60+
<Icon name="close" p='1' onClick={() => setIsOpen(false)}/>
61+
</Flex>
5962
{links.map(({ link, title }) => (
6063
<Box
6164
as={Link}
6265
px={1}
6366
to={link}
6467
key={link}
6568
fontFamily='body'
69+
py={3}
70+
fontSize={'desktop.3'}
71+
userSelect='none'
6672
>
6773
{title}
6874
</Box>

src/templates/layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ const Layout = ({ children }) => (
244244
<Global
245245
styles={globalStyle}
246246
/>
247-
<Box maxWidth='maxContainerWidth' m={['1' ,'auto']} fontSize={[1,'desktop.1']}>
247+
<Box maxWidth='maxContainerWidth' m='auto' mx={['1', 0]} fontSize={[1,'desktop.1']}>
248248
<Helmet
249249
meta={[
250250
{ name: "referrer", content: "origin" },

0 commit comments

Comments
 (0)