1
1
import {
2
2
Box ,
3
- IconButton ,
4
3
useColorModeValue ,
5
- useColorMode ,
6
4
Flex ,
7
5
} from '@chakra-ui/react' ;
8
6
import PropTypes from 'prop-types' ;
9
7
import useTranslation from 'next-translate/useTranslation' ;
10
8
import { useRouter } from 'next/router' ;
11
- import Icon from '../Icon' ;
12
9
import MobileNavItem from './MobileNavItem' ;
13
- import LanguageSelector from '../LanguageSelector' ;
14
10
import NextChakraLink from '../NextChakraLink' ;
15
11
import useStyle from '../../hooks/useStyle' ;
16
12
import { setStorageItem } from '../../utils' ;
17
13
18
14
function MobileNav ( {
19
- navbarItems, translations , onClickLink,
15
+ navbarItems, onClickLink,
20
16
} ) {
21
- const { colorMode, toggleColorMode } = useColorMode ( ) ;
22
17
const { t } = useTranslation ( 'navbar' ) ;
23
18
const router = useRouter ( ) ;
24
19
const prismicRef = process . env . PRISMIC_REF ;
25
20
const prismicApi = process . env . PRISMIC_API ;
26
- const { borderColor , navbarBackground } = useStyle ( ) ;
21
+ const { navbarBackground } = useStyle ( ) ;
27
22
28
23
return (
29
24
< Flex
@@ -96,43 +91,12 @@ function MobileNav({
96
91
{ t ( 'login' ) }
97
92
</ NextChakraLink >
98
93
</ Box >
99
- < Box
100
- borderTop = { 1 }
101
- borderStyle = "solid"
102
- borderColor = { borderColor }
103
- display = "flex"
104
- padding = "14px 0 0 0"
105
- justifyContent = "center"
106
- gridGap = "20px"
107
- >
108
- < IconButton
109
- display = "flex"
110
- _hover = { {
111
- background : navbarBackground ,
112
- } }
113
- _active = { {
114
- background : navbarBackground ,
115
- } }
116
- background = { navbarBackground }
117
- onClick = { toggleColorMode }
118
- title = "Toggle Color Mode"
119
- icon = {
120
- colorMode === 'light' ? (
121
- < Icon icon = "light" id = "light-button-mobile" width = "25px" height = "23px" color = "black" />
122
- ) : (
123
- < Icon icon = "dark" id = "dark-button-mobile" width = "20px" height = "20px" />
124
- )
125
- }
126
- />
127
- < LanguageSelector display = "block" translations = { translations } />
128
- </ Box >
129
94
</ Flex >
130
95
) ;
131
96
}
132
97
133
98
MobileNav . propTypes = {
134
99
navbarItems : PropTypes . arrayOf ( PropTypes . oneOfType ( [ PropTypes . any ] ) ) ,
135
- translations : PropTypes . oneOfType ( [ PropTypes . objectOf ( PropTypes . any ) , PropTypes . arrayOf ( PropTypes . any ) ] ) ,
136
100
onClickLink : PropTypes . func . isRequired ,
137
101
} ;
138
102
@@ -147,7 +111,6 @@ MobileNav.defaultProps = {
147
111
} ,
148
112
} ,
149
113
] ,
150
- translations : undefined ,
151
114
} ;
152
115
153
116
export default MobileNav ;
0 commit comments