Skip to content

Commit 47c9901

Browse files
authored
Merge pull request #2145 from lumi-tip/development-lumi-9601
changing on mobile positon of lang switcher and colormode
2 parents 6329c22 + 2b8e1be commit 47c9901

File tree

2 files changed

+7
-44
lines changed

2 files changed

+7
-44
lines changed

src/components/Navbar/MobileNav.jsx

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
import {
22
Box,
3-
IconButton,
43
useColorModeValue,
5-
useColorMode,
64
Flex,
75
} from '@chakra-ui/react';
86
import PropTypes from 'prop-types';
97
import useTranslation from 'next-translate/useTranslation';
108
import { useRouter } from 'next/router';
11-
import Icon from '../Icon';
129
import MobileNavItem from './MobileNavItem';
13-
import LanguageSelector from '../LanguageSelector';
1410
import NextChakraLink from '../NextChakraLink';
1511
import useStyle from '../../hooks/useStyle';
1612
import { setStorageItem } from '../../utils';
1713

1814
function MobileNav({
19-
navbarItems, translations, onClickLink,
15+
navbarItems, onClickLink,
2016
}) {
21-
const { colorMode, toggleColorMode } = useColorMode();
2217
const { t } = useTranslation('navbar');
2318
const router = useRouter();
2419
const prismicRef = process.env.PRISMIC_REF;
2520
const prismicApi = process.env.PRISMIC_API;
26-
const { borderColor, navbarBackground } = useStyle();
21+
const { navbarBackground } = useStyle();
2722

2823
return (
2924
<Flex
@@ -96,43 +91,12 @@ function MobileNav({
9691
{t('login')}
9792
</NextChakraLink>
9893
</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>
12994
</Flex>
13095
);
13196
}
13297

13398
MobileNav.propTypes = {
13499
navbarItems: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.any])),
135-
translations: PropTypes.oneOfType([PropTypes.objectOf(PropTypes.any), PropTypes.arrayOf(PropTypes.any)]),
136100
onClickLink: PropTypes.func.isRequired,
137101
};
138102

@@ -147,7 +111,6 @@ MobileNav.defaultProps = {
147111
},
148112
},
149113
],
150-
translations: undefined,
151114
};
152115

153116
export default MobileNav;

src/components/Navbar/index.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,17 @@ function Navbar({ translations, pageProps }) {
297297
</Flex>
298298
</Flex>
299299

300-
<Stack justify="flex-end" alignItems="center" direction="row" gridGap={hasPaidSubscription ? '16px' : '20px'}>
301-
<Flex display={{ base: 'none', md: 'flex' }} gridGap="18px">
300+
<Stack justify="flex-end" alignItems="center" direction="row" gridGap="14px">
301+
<Flex display="flex" gridGap={{ base: '10px', md: '18px' }}>
302302
{disableLangSwitcher !== true && (
303-
<LanguageSelector display={{ base: 'none ', lg: 'block' }} translations={translations} minWidth="unset" />
303+
<LanguageSelector display="block" translations={translations} minWidth="unset" />
304304
)}
305305
<IconButton
306306
style={{
307307
margin: 0,
308308
minWidth: 'unset',
309309
}}
310-
display={{ base: 'none', lg: 'flex' }}
310+
display="flex"
311311
height="auto"
312312
_hover={{
313313
background: navbarBackground,
@@ -333,7 +333,7 @@ function Navbar({ translations, pageProps }) {
333333
<Divider orientation="vertical" borderColor={hexColor.fontColor3} opacity={0.5} />
334334
</Box>
335335
{hasPaidSubscription && (
336-
<Box display="flex" alignItems="center" height="100%" zIndex={10}>
336+
<Box display={{ base: 'none', md: 'flex' }} alignItems="center" height="100%" zIndex={10}>
337337
<Icon icon="crown" width="20px" height="26px" color="" />
338338
</Box>
339339
)}

0 commit comments

Comments
 (0)