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

Merge branch 'it18218640' into 'master'

add home.js

See merge request !13
parents 6bd2e425 c5dcb363
import React from "react";
import { NavigationContainer } from '@react-navigation/native';
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 Login from "../screen/auth/Login";
import Splash from "../screen/splash/Splash";
......@@ -17,6 +18,7 @@ return(
<Stack.Screen options={{headerShown:false}} name="Splash" component={Splash} />
<Stack.Screen options={{headerShown:false}} name="Register" component={Register} />
<Stack.Screen options={{headerShown:false}} name="Login" component={Login} />
<Stack.Screen options={{headerShown:false}} name="Start" component={Start} />
</Stack.Navigator>
</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 = () => {
</View>
<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}>
Sign In
</Text>
......
......@@ -34,7 +34,7 @@ const Register = () => {
</View>
<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}>
Sign Up
</Text>
......
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 profile from "./profile";
import report from "./report";
import { StyleSheet, View, Text, Pressable } from 'react-native';
const Drawer = createDrawerNavigator();
export default function Home({ navigation }){
function Home() {
const onPressHandler = () => {
navigation.navigate('Start');
}
return (
<View>
<Text>Home</Text>
</View>
)
<Drawer.Navigator
initialRouteName="Profile"
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';
export default function profile({ navigation }){
const onPressHandler = () => {
navigation.navigate('home');
navigation.navigate('Start');
}
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