From 9cb319b4df7e5ecb0740525bbb5c8f12a04fb619 Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Fri, 22 Oct 2021 16:13:28 -0300 Subject: [PATCH] Adjusting user params to API --- src/app/auth/storage.js | 2 +- src/app/screens/AccountScreen.js | 2 +- src/app/screens/ActivateInstitutionCode.js | 17 +++++++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/app/auth/storage.js b/src/app/auth/storage.js index ce28423..30a603e 100644 --- a/src/app/auth/storage.js +++ b/src/app/auth/storage.js @@ -32,4 +32,4 @@ const getUser = async () => { return token ? jwtDecode(token) : null; }; -export default { setToken, getUser, removeToken }; +export default { setToken, getUser, removeToken, getToken }; diff --git a/src/app/screens/AccountScreen.js b/src/app/screens/AccountScreen.js index b8559bd..e5a1c9f 100644 --- a/src/app/screens/AccountScreen.js +++ b/src/app/screens/AccountScreen.js @@ -132,7 +132,7 @@ function AccountScreen(props) { padding: 16, }} > - + {profileItems.map(({ icon, IconProvider, title, onPress }) => ( diff --git a/src/app/screens/ActivateInstitutionCode.js b/src/app/screens/ActivateInstitutionCode.js index 7f41110..fdcc7ff 100644 --- a/src/app/screens/ActivateInstitutionCode.js +++ b/src/app/screens/ActivateInstitutionCode.js @@ -5,6 +5,10 @@ import colors from "../config/colors"; import Button from "../components/Button"; import { MaterialCommunityIcons } from "@expo/vector-icons"; import { AuthContext } from "../auth/context"; +import authStorage from "../auth/storage"; + + + import { Form, SubmitButton, @@ -13,6 +17,7 @@ import { } from "../components/forms"; import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; import ConfirmationModal from "../components/ConfirmationModal"; +import {userPersonalData} from "../api/auth"; function Header() { return ( @@ -38,12 +43,20 @@ function Header() { } function Institution({ user, institutionRole }) { + var institutionMap = { + E: "Escola", + D: "Defesa Civil", + N: "Não governamental", + O: "Outra", + N: "Nenhuma" + }; + return ( Tippo de instituição: - {user.institutionType} + {institutionMap[user.institutiontype]} @@ -51,7 +64,7 @@ function Institution({ user, institutionRole }) { - {user.institutionName} + {user.institution}