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";
33import { List , Text } from "react-native-paper" ;
44
55import { ScreenContainer } from "~/components/ScreenContainer" ;
6+ import { useAuthentication } from "~/context/Authentication" ;
67import { Routes } from "~/navigation/Routes" ;
78
8- interface Props { }
9-
10- export const PlusScreen = ( { navigation } : Props ) => {
9+ export const PlusScreen = ( { navigation } : any ) => {
1110 const navigateToDoYouLikeScreen = ( ) => {
1211 navigation . navigate ( Routes . DO_YOU_LIKE_SCREEN ) ;
1312 } ;
1413
14+ const { setUser } = useAuthentication ( ) ;
15+ const handleLogout = ( ) => {
16+ setUser ( false ) ;
17+ } ;
18+
1519 return (
1620 < ScreenContainer title = { "Plus" } >
1721 < View style = { { flex : 1 } } >
@@ -25,6 +29,16 @@ export const PlusScreen = ({ navigation }: Props) => {
2529 onPress = { navigateToDoYouLikeScreen }
2630 title = "Do you like Spacecraft?"
2731 />
32+ < List . Item
33+ left = { ( props ) => (
34+ < List . Icon
35+ { ...props }
36+ icon = "logout"
37+ />
38+ ) }
39+ onPress = { handleLogout }
40+ title = "Logout"
41+ />
2842 </ View >
2943 < View
3044 style = { {
You can’t perform that action at this time.
0 commit comments