615 Use translation library for bottom menu

This commit is contained in:
Lisa Hillebrand
2022-09-30 11:39:00 +02:00
parent 9dfe8b4b05
commit 36c33c69b7
3 changed files with 14 additions and 6 deletions
+6 -3
View File
@@ -6,20 +6,23 @@ import MenuItem from './menu-item'
import { Containers } from '../../styles'
import { pages } from '../pages'
import { useTranslation } from 'react-i18next'
const Menu = ({ currentPage, navigate }) => {
const menuItems = pages.filter((page) => page.isInMenu)
const { t } = useTranslation(null, { keyPrefix: 'bottomMenu' })
return (
<View style={styles.container}>
{menuItems.map(({ icon, label, component }) => {
{menuItems.map(({ icon, labelKey, component }) => {
return (
<MenuItem
isActive={component === currentPage}
onPress={() => navigate(component)}
icon={icon}
key={label}
label={label}
key={labelKey}
label={t(labelKey)}
/>
)
})}