Add stack&bottom-tab navigation to App&move out closeDB&notifications

This commit is contained in:
MariaZ
2022-09-28 19:58:33 +02:00
parent d17e7ed6a2
commit b6024ae921
5 changed files with 77 additions and 105 deletions
-42
View File
@@ -1,42 +0,0 @@
import React from 'react'
import { StyleSheet, View } from 'react-native'
import PropTypes from 'prop-types'
import MenuItem from './menu-item'
import { Containers } from '../../styles'
import { pages } from '../pages'
const Menu = ({ currentPage, navigate }) => {
const menuItems = pages.filter((page) => page.isInMenu)
return (
<View style={styles.container}>
{menuItems.map(({ icon, label, component }) => {
return (
<MenuItem
isActive={component === currentPage}
onPress={() => navigate(component)}
icon={icon}
key={label}
label={label}
/>
)
})}
</View>
)
}
Menu.propTypes = {
currentPage: PropTypes.string,
navigate: PropTypes.func,
}
const styles = StyleSheet.create({
container: {
backgroundColor: 'white',
...Containers.rowContainer,
},
})
export default Menu