Chore/retire redux
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
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 = () => {
|
||||
const Menu = ({ currentPage, navigate }) => {
|
||||
const menuItems = pages.filter((page) => page.isInMenu)
|
||||
|
||||
return (
|
||||
@@ -14,7 +15,8 @@ const Menu = () => {
|
||||
{menuItems.map(({ icon, label, component }) => {
|
||||
return (
|
||||
<MenuItem
|
||||
component={component}
|
||||
isActive={component === currentPage}
|
||||
onPress={() => navigate(component)}
|
||||
icon={icon}
|
||||
key={label}
|
||||
label={label}
|
||||
@@ -25,6 +27,11 @@ const Menu = () => {
|
||||
)
|
||||
}
|
||||
|
||||
Menu.propTypes = {
|
||||
currentPage: PropTypes.string,
|
||||
navigate: PropTypes.func,
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
backgroundColor: 'white',
|
||||
|
||||
Reference in New Issue
Block a user