update: navigation drawer

parent 913733db
...@@ -25,8 +25,8 @@ export default function App() { ...@@ -25,8 +25,8 @@ export default function App() {
<NavigationContainer> <NavigationContainer>
<Drawer.Navigator initialRouteName="Authntications"> <Drawer.Navigator initialRouteName="Authntications">
<Drawer.Screen name="Authentications" component={AuthStack} /> <Drawer.Screen name="HOME" component={AuthStack} />
{/* <Drawer.Screen name="Agripreneurs" component={BottomTab} /> */} <Drawer.Screen name="About Us" component={homeStack} />
{/* <Drawer.Screen name="MainTab" component={MainTabScreen} /> */} {/* <Drawer.Screen name="MainTab" component={MainTabScreen} /> */}
{/* <Drawer.Screen name="About Us" component={AboutUs} /> */} {/* <Drawer.Screen name="About Us" component={AboutUs} /> */}
</Drawer.Navigator> </Drawer.Navigator>
......
...@@ -8,6 +8,7 @@ import { HomeScreen } from "../screen/HomeScreen"; ...@@ -8,6 +8,7 @@ import { HomeScreen } from "../screen/HomeScreen";
import { Leaderboard } from "../screen/Leaderboard"; import { Leaderboard } from "../screen/Leaderboard";
import { PriceScreen } from "../screen/PriceScreen"; import { PriceScreen } from "../screen/PriceScreen";
import { gamification } from "../screen/gamification"; import { gamification } from "../screen/gamification";
import { IotScreen } from "../screen/IotScreen";
import { AboutUs } from "../screen/AboutUs"; import { AboutUs } from "../screen/AboutUs";
import axios from "axios"; import axios from "axios";
...@@ -20,28 +21,28 @@ export function AuthStack({ navigation }) { ...@@ -20,28 +21,28 @@ export function AuthStack({ navigation }) {
name="SignIn" name="SignIn"
component={SignIn} component={SignIn}
options={{ options={{
headerLeft: () => { // headerLeft: () => {
return ( // return (
<Ionicons // <Ionicons
name="md-menu" // name="md-menu"
size={30} // size={30}
color="black" // color="black"
onPress={() => navigation.openDrawer()} // onPress={() => navigation.openDrawer()}
/> // />
); // );
}, // },
headerStyle: { headerStyle: {
backgroundColor: 'white', backgroundColor: 'white',
}, },
headerLeftContainerStyle: { paddingLeft: 10 }, headerTitleAlign: "center",
headerRight: () => { // headerRight: () => {
return ( // return (
<MaterialIcons name="logout" // <MaterialIcons name="logout"
size={30} // size={30}
color="black" // color="black"
/> // />
); // );
}, // },
}} }}
/> />
<Stack.Screen <Stack.Screen
...@@ -52,12 +53,34 @@ export function AuthStack({ navigation }) { ...@@ -52,12 +53,34 @@ export function AuthStack({ navigation }) {
headerTitleAlign: "center", headerTitleAlign: "center",
}} }}
/> />
<Stack.Screen
name="IotScreen"
component={IotScreen}
options={{
title: "IOT Page",
headerTitleAlign: "center",
}}
/>
<Stack.Screen <Stack.Screen
name="HomeScreen" name="HomeScreen"
component={HomeScreen} component={HomeScreen}
options={{ options={{
title: "Agripreneurs", title: "Agripreneurs",
headerTitleAlign: "center", headerTitleAlign: "center",
headerLeft: () => {
return (
<Ionicons
name="md-menu"
size={30}
color="black"
onPress={() => navigation.openDrawer()}
/>
);
},
headerStyle: {
backgroundColor: 'white',
},
headerLeftContainerStyle: { paddingLeft: 10 },
headerRight: () => { headerRight: () => {
return ( return (
<MaterialIcons name="logout" <MaterialIcons name="logout"
......
...@@ -6,6 +6,7 @@ import { HomeScreen } from "../screen/HomeScreen"; ...@@ -6,6 +6,7 @@ import { HomeScreen } from "../screen/HomeScreen";
import { Leaderboard } from "../screen/Leaderboard"; import { Leaderboard } from "../screen/Leaderboard";
import { PriceScreen } from "../screen/PriceScreen"; import { PriceScreen } from "../screen/PriceScreen";
import { gamification } from "../screen/gamification"; import { gamification } from "../screen/gamification";
import { AboutUs } from "../screen/AboutUs"; import { AboutUs } from "../screen/AboutUs";
const Stack = createStackNavigator(); const Stack = createStackNavigator();
...@@ -13,7 +14,7 @@ const Stack = createStackNavigator(); ...@@ -13,7 +14,7 @@ const Stack = createStackNavigator();
export function homeStack({ navigation }) { export function homeStack({ navigation }) {
return ( return (
<Stack.Navigator> <Stack.Navigator>
<Stack.Screen {/* <Stack.Screen
name="Agripreneurs" name="Agripreneurs"
component={HomeScreen} component={HomeScreen}
options={{ options={{
...@@ -56,7 +57,7 @@ export function homeStack({ navigation }) { ...@@ -56,7 +57,7 @@ export function homeStack({ navigation }) {
title: "Gamification Page", title: "Gamification Page",
headerTitleAlign: "center", headerTitleAlign: "center",
}} }}
/> /> */}
<Stack.Screen <Stack.Screen
name="AboutUs" name="AboutUs"
component={AboutUs} component={AboutUs}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment