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
+6 -4
View File
@@ -7,17 +7,17 @@ import HamburgerMenu from './hamburger-menu'
import { Colors, Containers, Sizes } from '../../styles'
const Header = ({ isStatic, navigate }) => {
const Header = ({ isStatic, navigation }) => {
return (
<View style={styles.header}>
{isStatic ? (
<Logo />
) : (
<>
<TouchableOpacity onPress={() => navigate('Home')}>
<TouchableOpacity onPress={() => navigation.navigate('Home')}>
<Logo />
</TouchableOpacity>
<HamburgerMenu navigate={navigate} />
<HamburgerMenu navigate={navigation.navigate} />
</>
)}
</View>
@@ -26,7 +26,9 @@ const Header = ({ isStatic, navigate }) => {
Header.propTypes = {
isStatic: PropTypes.bool,
navigate: PropTypes.func,
navigation: PropTypes.shape({
navigate: PropTypes.func.isRequired,
}).isRequired,
}
Header.defaultProps = {