forked from cemaden-educacao/WPD-MobileApp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
819 B
37 lines
819 B
import React, { useContext } from "react";
|
|
import { Text, Button } from "react-native";
|
|
import Screen from "../components/Screen";
|
|
import InDevelopment from "../components/InDevelopment";
|
|
import { AuthContext } from "../auth/context";
|
|
import authStorage from "../auth/storage";
|
|
|
|
function handleLogOut(setUser) {
|
|
setUser(null);
|
|
authStorage.removeToken();
|
|
}
|
|
|
|
function AccountScreen(props) {
|
|
const { user, setUser } = useContext(AuthContext);
|
|
|
|
return (
|
|
<Screen
|
|
style={{
|
|
padding: 10,
|
|
}}
|
|
>
|
|
<Text>{user.name}</Text>
|
|
<Text>{user.email}</Text>
|
|
<Button
|
|
style={{ paddingTop: 10 }}
|
|
title="Logout"
|
|
onPress={() => {
|
|
handleLogOut(setUser);
|
|
}}
|
|
/>
|
|
|
|
{/* <InDevelopment /> */}
|
|
</Screen>
|
|
);
|
|
}
|
|
|
|
export default AccountScreen;
|