mirror of
https://github.com/fergalmoran/argon-react-native.git
synced 2026-01-07 00:56:25 +00:00
Dependencies updated & Stack navigator issues fixed
This commit is contained in:
@@ -1,26 +1,23 @@
|
||||
import React from "react";
|
||||
import {
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Image
|
||||
} from "react-native";
|
||||
import { Block, Text, theme } from "galio-framework";
|
||||
import { Image, ScrollView, StyleSheet } from "react-native";
|
||||
|
||||
import { DrawerItem as DrawerCustomItem } from "../components";
|
||||
import Images from "../constants/Images";
|
||||
import { DrawerItem as DrawerCustomItem } from '../components';
|
||||
import React from "react";
|
||||
|
||||
function CustomDrawerContent({ drawerPosition, navigation, profile, focused, state, ...rest }) {
|
||||
const screens = [
|
||||
"Home",
|
||||
"Profile",
|
||||
"Account",
|
||||
"Elements",
|
||||
"Articles",
|
||||
];
|
||||
function CustomDrawerContent({
|
||||
drawerPosition,
|
||||
navigation,
|
||||
profile,
|
||||
focused,
|
||||
state,
|
||||
...rest
|
||||
}) {
|
||||
const screens = ["Home", "Profile", "Account", "Elements", "Articles"];
|
||||
return (
|
||||
<Block
|
||||
style={styles.container}
|
||||
forceInset={{ top: 'always', horizontal: 'never' }}
|
||||
forceInset={{ top: "always", horizontal: "never" }}
|
||||
>
|
||||
<Block flex={0.06} style={styles.header}>
|
||||
<Image styles={styles.logo} source={Images.Logo} />
|
||||
@@ -28,27 +25,37 @@ function CustomDrawerContent({ drawerPosition, navigation, profile, focused, sta
|
||||
<Block flex style={{ paddingLeft: 8, paddingRight: 14 }}>
|
||||
<ScrollView style={{ flex: 1 }} showsVerticalScrollIndicator={false}>
|
||||
{screens.map((item, index) => {
|
||||
return (
|
||||
<DrawerCustomItem
|
||||
title={item}
|
||||
key={index}
|
||||
navigation={navigation}
|
||||
focused={state.index === index ? true : false}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
<Block flex style={{ marginTop: 24, marginVertical: 8, paddingHorizontal: 8 }}>
|
||||
<Block style={{ borderColor: "rgba(0,0,0,0.2)", width: '100%', borderWidth: StyleSheet.hairlineWidth }}/>
|
||||
<Text color="#8898AA" style={{ marginTop: 16, marginLeft: 8 }}>DOCUMENTATION</Text>
|
||||
</Block>
|
||||
<DrawerCustomItem title="Getting Started" navigation={navigation} />
|
||||
return (
|
||||
<DrawerCustomItem
|
||||
title={item}
|
||||
key={index}
|
||||
navigation={navigation}
|
||||
focused={state.index === index ? true : false}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
<Block
|
||||
flex
|
||||
style={{ marginTop: 24, marginVertical: 8, paddingHorizontal: 8 }}
|
||||
>
|
||||
<Block
|
||||
style={{
|
||||
borderColor: "rgba(0,0,0,0.2)",
|
||||
width: "100%",
|
||||
borderWidth: StyleSheet.hairlineWidth,
|
||||
}}
|
||||
/>
|
||||
<Text color="#8898AA" style={{ marginTop: 16, marginLeft: 8 }}>
|
||||
DOCUMENTATION
|
||||
</Text>
|
||||
</Block>
|
||||
<DrawerCustomItem title="Getting Started" navigation={navigation} />
|
||||
</ScrollView>
|
||||
</Block>
|
||||
</Block>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
@@ -57,8 +64,8 @@ const styles = StyleSheet.create({
|
||||
paddingHorizontal: 28,
|
||||
paddingBottom: theme.SIZES.BASE,
|
||||
paddingTop: theme.SIZES.BASE * 3,
|
||||
justifyContent: 'center'
|
||||
}
|
||||
justifyContent: "center",
|
||||
},
|
||||
});
|
||||
|
||||
export default CustomDrawerContent;
|
||||
|
||||
@@ -66,7 +66,12 @@ function ElementsStack(props) {
|
||||
|
||||
function ArticlesStack(props) {
|
||||
return (
|
||||
<Stack.Navigator mode="card" headerMode="screen">
|
||||
<Stack.Navigator
|
||||
screenOptions={{
|
||||
mode: "card",
|
||||
headerShown: "screen",
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="Articles"
|
||||
component={Articles}
|
||||
@@ -100,7 +105,13 @@ function ArticlesStack(props) {
|
||||
|
||||
function ProfileStack(props) {
|
||||
return (
|
||||
<Stack.Navigator initialRouteName="Profile" mode="card" headerMode="screen">
|
||||
<Stack.Navigator
|
||||
initialRouteName="Profile"
|
||||
screenOptions={{
|
||||
mode: "card",
|
||||
headerShown: "screen",
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="Profile"
|
||||
component={Profile}
|
||||
@@ -141,7 +152,12 @@ function ProfileStack(props) {
|
||||
|
||||
function HomeStack(props) {
|
||||
return (
|
||||
<Stack.Navigator mode="card" headerMode="screen">
|
||||
<Stack.Navigator
|
||||
screenOptions={{
|
||||
mode: "card",
|
||||
headerShown: "screen",
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="Home"
|
||||
component={Home}
|
||||
@@ -181,7 +197,12 @@ function HomeStack(props) {
|
||||
|
||||
export default function OnboardingStack(props) {
|
||||
return (
|
||||
<Stack.Navigator mode="card" headerMode="none">
|
||||
<Stack.Navigator
|
||||
screenOptions={{
|
||||
mode: "card",
|
||||
headerShown: false,
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="Onboarding"
|
||||
component={Onboarding}
|
||||
|
||||
Reference in New Issue
Block a user