Commit a11b2a90 authored by W.D.R.P. Sandeepa's avatar W.D.R.P. Sandeepa

add home.js

parent 2abe6d60
import React from "react"; import React from "react";
import { NavigationContainer } from '@react-navigation/native'; import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { createNativeStackNavigator } from '@react-navigation/native-stack';
import Home from "../screen/Home";
import Home from "../screen/Home";
import Start from "../screen/Start"
import Register from "../screen/auth/Register"; import Register from "../screen/auth/Register";
import Login from "../screen/auth/Login"; import Login from "../screen/auth/Login";
import Splash from "../screen/splash/Splash"; import Splash from "../screen/splash/Splash";
...@@ -17,6 +18,7 @@ return( ...@@ -17,6 +18,7 @@ return(
<Stack.Screen options={{headerShown:false}} name="Splash" component={Splash} /> <Stack.Screen options={{headerShown:false}} name="Splash" component={Splash} />
<Stack.Screen options={{headerShown:false}} name="Register" component={Register} /> <Stack.Screen options={{headerShown:false}} name="Register" component={Register} />
<Stack.Screen options={{headerShown:false}} name="Login" component={Login} /> <Stack.Screen options={{headerShown:false}} name="Login" component={Login} />
<Stack.Screen options={{headerShown:false}} name="Start" component={Start} />
</Stack.Navigator> </Stack.Navigator>
</NavigationContainer> </NavigationContainer>
) )
......
import React from "react";
import { SafeAreaView, ScrollView, View, Text } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createDrawerNavigator, DrawerItem } from "@react-navigation/drawer";
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
import Home from "./Home";
import profile from "./profile";
import report from "./report";
const Drawer = createDrawerNavigator();
function Start() {
return (
<Drawer.Navigator
initialRouteName="Home"
screenOptions={{
hearderTitleAlign: 'right',
alignItems: 'center',
justifyContent: 'center',
headerStyle:{
backgroundColor: '#1DCE92'
},
headerTintColor: '#ffffff'
}}>
<Drawer.Screen name="Home"
component={Home}
options={{
title: 'Home',
drawerIcon: ({focused}) => (
<FontAwesome5
name="home"
size={focused ? 25:20}
color={focused ? '#1DCE92' : '#0096FF'}
/>
)
}}
/>
<Drawer.Screen name="Profile"
component={profile}
options={{
title: 'Profile',
drawerIcon: ({focused}) => (
<FontAwesome5
name="users"
size={focused ? 25:20}
color={focused ? '#1DCE92' : '#0096FF'}
/>
)
}}
/>
<Drawer.Screen name="Report"
component={report}
options={{
title: 'Report',
drawerIcon: ({focused}) => (
<FontAwesome5
name="chart-line"
size={focused ? 25:20}
color={focused ? '#1DCE92' : '#0096FF'}
/>
)
}}
/>
</Drawer.Navigator>
);
}
export default Start;
\ No newline at end of file
...@@ -25,7 +25,7 @@ const Login = () => { ...@@ -25,7 +25,7 @@ const Login = () => {
</View> </View>
<View style={styles.form_input}> <View style={styles.form_input}>
<TouchableOpacity onPress={()=> { navigation.navigate("Home")}} style={styles.btn}> <TouchableOpacity onPress={()=> { navigation.navigate("Start")}} style={styles.btn}>
<Text style={styles.btn_text}> <Text style={styles.btn_text}>
Sign In Sign In
</Text> </Text>
......
...@@ -34,7 +34,7 @@ const Register = () => { ...@@ -34,7 +34,7 @@ const Register = () => {
</View> </View>
<View style={styles.form_input}> <View style={styles.form_input}>
<TouchableOpacity onPress={()=> { navigation.navigate("Home")}} style={styles.btn}> <TouchableOpacity onPress={()=> { navigation.navigate("Start")}} style={styles.btn}>
<Text style={styles.btn_text}> <Text style={styles.btn_text}>
Sign Up Sign Up
</Text> </Text>
......
import React from "react"; import React from "react";
import { SafeAreaView, ScrollView, View, Text } from "react-native"; import { StyleSheet, View, Text, Pressable } from 'react-native';
import { NavigationContainer } from "@react-navigation/native";
import { createDrawerNavigator, DrawerItem } from "@react-navigation/drawer";
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
import profile from "./profile";
import report from "./report";
const Drawer = createDrawerNavigator(); export default function Home({ navigation }){
function Home() { const onPressHandler = () => {
navigation.navigate('Start');
}
return ( return (
<View>
<Drawer.Navigator <Text>Home</Text>
initialRouteName="Profile" </View>
screenOptions={{
hearderTitleAlign: 'right',
alignItems: 'center',
justifyContent: 'center',
headerStyle:{
backgroundColor: '#1DCE92'
},
headerTintColor: '#ffffff'
}}>
<Drawer.Screen name="Profile"
component={profile}
options={{
title: 'Profile',
drawerIcon: ({focused}) => (
<FontAwesome5
name="users"
size={focused ? 25:20}
color={focused ? '#1DCE92' : '#0096FF'}
/>
)
}}
/>
<Drawer.Screen name="Report"
component={report}
options={{
title: 'Report',
drawerIcon: ({focused}) => (
<FontAwesome5
name="chart-line"
size={focused ? 25:20}
color={focused ? '#1DCE92' : '#0096FF'}
/>
) )
}}
/>
</Drawer.Navigator>
);
}
export default Home; }
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,7 @@ import { StyleSheet, View, Text, Pressable } from 'react-native'; ...@@ -4,7 +4,7 @@ import { StyleSheet, View, Text, Pressable } from 'react-native';
export default function profile({ navigation }){ export default function profile({ navigation }){
const onPressHandler = () => { const onPressHandler = () => {
navigation.navigate('home'); navigation.navigate('Start');
} }
return ( return (
......
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