Skip to content

Commit

Permalink
disable temporary locale fab
Browse files Browse the repository at this point in the history
  • Loading branch information
martinezguillaume committed Feb 12, 2024
1 parent 7acecda commit cdc7ee0
Showing 1 changed file with 28 additions and 32 deletions.
60 changes: 28 additions & 32 deletions components/LocaleFab.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
import {Fab, Menu} from 'native-base'
import {FC, memo} from 'react'

import {i18n} from '@/i18n'
import {useAppStore} from '@/store'

export const LocaleFab: FC = memo(() => {
const setLocale = useAppStore(state => state.setLocale)
const locale = useAppStore(state => state.locale)

return (
<Menu
// eslint-disable-next-line react/no-unstable-nested-components
trigger={triggerProps => (
<Fab
{...triggerProps}
height="56px"
width="56px"
_dark={{bg: 'white'}}
_light={{bg: 'black'}}
p={0}
_text={{fontSize: '2xl'}}
label={locale === 'fr' ? '🇫🇷' : '🇬🇧'}
/>
)}>
<Menu.OptionGroup
defaultValue={locale}
title={i18n.t('home.language')}
type="radio"
onChange={setLocale}>
<Menu.ItemOption value="fr">🇫🇷 Français</Menu.ItemOption>
<Menu.ItemOption value="en">🇬🇧 English</Menu.ItemOption>
</Menu.OptionGroup>
</Menu>
)
// const setLocale = useLocalStore(state => state.setLocale)
// const locale = useLocalStore(state => state.locale)
return null
// return (
// <Menu
// // eslint-disable-next-line react/no-unstable-nested-components
// trigger={triggerProps => (
// <Fab
// {...triggerProps}
// height="56px"
// width="56px"
// _dark={{bg: 'white'}}
// _light={{bg: 'black'}}
// p={0}
// _text={{fontSize: '2xl'}}
// label={locale === 'fr' ? '🇫🇷' : '🇬🇧'}
// />
// )}>
// <Menu.OptionGroup
// defaultValue={locale}
// title={i18n.t('home.language')}
// type="radio"
// onChange={setLocale}>
// <Menu.ItemOption value="fr">🇫🇷 Français</Menu.ItemOption>
// <Menu.ItemOption value="en">🇬🇧 English</Menu.ItemOption>
// </Menu.OptionGroup>
// </Menu>
// )
})

0 comments on commit cdc7ee0

Please sign in to comment.