-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuth.js
More file actions
26 lines (22 loc) · 744 Bytes
/
Auth.js
File metadata and controls
26 lines (22 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import React, { useContext } from "react";
import {View, Text, Button} from "react-native";
import AuthContext from "./auth-context";
const Auth = () => {
const auth = useContext(AuthContext);
console.log(auth.status);
return (
<View style={{flex:1, alignItems:"center", justifyContent:'center', backgroundColor:"#F3C5C5" }}>
<Text style={{fontSize:26}}>AUTHENTICATION{'\n'}using useContext{'\n'}</Text>
<Text style={{fontSize:20}}>Are you authenticated?{'\n'}</Text>
<Text style={{fontSize:16}}>
{auth.status ?
<Text>Yes you are!</Text>
:
<Text>Nope!</Text>
} {'\n'}
</Text>
<Button color="#886F6F" title="Click to Login" onPress={auth.login}/>
</View>
);
};
export default Auth;