File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
hackathon/spacecraft/src/screens Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,19 @@ import { View } from "react-native";
3
3
import { List , Text } from "react-native-paper" ;
4
4
5
5
import { ScreenContainer } from "~/components/ScreenContainer" ;
6
+ import { useAuthentication } from "~/context/Authentication" ;
6
7
import { Routes } from "~/navigation/Routes" ;
7
8
8
- interface Props { }
9
-
10
- export const PlusScreen = ( { navigation } : Props ) => {
9
+ export const PlusScreen = ( { navigation } : any ) => {
11
10
const navigateToDoYouLikeScreen = ( ) => {
12
11
navigation . navigate ( Routes . DO_YOU_LIKE_SCREEN ) ;
13
12
} ;
14
13
14
+ const { setUser } = useAuthentication ( ) ;
15
+ const handleLogout = ( ) => {
16
+ setUser ( false ) ;
17
+ } ;
18
+
15
19
return (
16
20
< ScreenContainer title = { "Plus" } >
17
21
< View style = { { flex : 1 } } >
@@ -25,6 +29,16 @@ export const PlusScreen = ({ navigation }: Props) => {
25
29
onPress = { navigateToDoYouLikeScreen }
26
30
title = "Do you like Spacecraft?"
27
31
/>
32
+ < List . Item
33
+ left = { ( props ) => (
34
+ < List . Icon
35
+ { ...props }
36
+ icon = "logout"
37
+ />
38
+ ) }
39
+ onPress = { handleLogout }
40
+ title = "Logout"
41
+ />
28
42
</ View >
29
43
< View
30
44
style = { {
You can’t perform that action at this time.
0 commit comments