Skip to content

Commit

Permalink
Merge branch 'develop' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
LoisChen68 committed Dec 6, 2024
2 parents 1fcdd1b + 34b7ff1 commit 9643888
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/components/common/LocaleCollapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const BlankIcon = styled.i`

const LocaleCollapse: React.FC = () => {
const { isOpen, onToggle } = useDisclosure()
const { currentLocale, setCurrentLocale } = useContext(LocaleContext)
const { currentLocale, setCurrentLocale, languagesList } = useContext(LocaleContext)
return (
<>
<Box d="flex" justifyContent="space-between" cursor="pointer" onClick={onToggle}>
Expand All @@ -33,14 +33,16 @@ const LocaleCollapse: React.FC = () => {
</StyledCollapseIconWrapper>
</Box>
<Collapse in={isOpen} animateOpacity style={{ background: '#f7f8f8', margin: '0 -12px' }}>
{SUPPORTED_LOCALES.filter(v => v.locale !== currentLocale).map(v => (
<Box ml="3rem" style={{ cursor: 'pointer' }}>
<List.Item key={v.locale} onClick={() => setCurrentLocale?.(v.locale)}>
<BlankIcon className="mr-2" />
{v.label}
</List.Item>
</Box>
))}
{languagesList
.filter(v => v.locale !== currentLocale)
.map(v => (
<Box ml="3rem" style={{ cursor: 'pointer' }}>
<List.Item key={v.locale} onClick={() => setCurrentLocale?.(v.locale)}>
<BlankIcon className="mr-2" />
{v.label}
</List.Item>
</Box>
))}
</Collapse>
</>
)
Expand Down

0 comments on commit 9643888

Please sign in to comment.