Skip to content

Commit

Permalink
add change langue in mobile menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Janderson Souza Matias authored and Janderson Souza Matias committed Feb 6, 2024
1 parent 3fc78a2 commit 4a1f0ad
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,34 @@ const Navbar: React.FC = () => {
),
)}
</VStack>

<Menu>
<MenuButton
w="calc(100% - 32px)"
mx="16px"
mt="auto"
mb="16px"
bg="white"
shadow="md"
as={Button}
rightIcon={<ChevronDownIcon />}
>
{LANG_OPTIONS.filter((item) => item.value === i18n.language)[0].label}
</MenuButton>
<MenuList>
{LANG_OPTIONS.map((item) => (
<MenuItem
minH="48px"
key={item.value}
value={item.value}
onClick={() => changeLanguage(item.value)}
isDisabled={i18n.language === item.value}
>
{item.label}
</MenuItem>
))}
</MenuList>
</Menu>
</>
);

Expand Down Expand Up @@ -117,34 +145,6 @@ const Navbar: React.FC = () => {
{menu}
</>
)}

<Menu>
<MenuButton
w="calc(100% - 32px)"
mx="16px"
mt="auto"
mb="16px"
bg="white"
shadow="md"
as={Button}
rightIcon={<ChevronDownIcon />}
>
{LANG_OPTIONS.filter((item) => item.value === i18n.language)[0].label}
</MenuButton>
<MenuList>
{LANG_OPTIONS.map((item) => (
<MenuItem
minH="48px"
key={item.value}
value={item.value}
onClick={() => changeLanguage(item.value)}
isDisabled={i18n.language === item.value}
>
{item.label}
</MenuItem>
))}
</MenuList>
</Menu>
</VStack>
);
};
Expand Down

0 comments on commit 4a1f0ad

Please sign in to comment.