Browse Source

Adjusting user params to API

master
GabrielTrettel 3 years ago
parent
commit
9cb319b4df
  1. 2
      src/app/auth/storage.js
  2. 2
      src/app/screens/AccountScreen.js
  3. 17
      src/app/screens/ActivateInstitutionCode.js

2
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 };

2
src/app/screens/AccountScreen.js

@ -132,7 +132,7 @@ function AccountScreen(props) {
padding: 16,
}}
>
<UserHeader name={user.name} fone={user.email} image={"1"} />
<UserHeader name={user.nickname} fone={user.username} image={"1"} />
<View style={{ marginTop: 24 }}>
{profileItems.map(({ icon, IconProvider, title, onPress }) => (

17
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 (
<View style={{ marginTop: 24, marginBottom: 24 }}>
<Text style={styles.label}>Tippo de instituição: </Text>
<View style={{ flexDirection: "row" }}>
<MaterialCommunityIcons name="bank" size={30} color={colors.primary} />
<Text style={styles.subText}>{user.institutionType}</Text>
<Text style={styles.subText}>{institutionMap[user.institutiontype]}</Text>
</View>
<Text style={[styles.label, { marginTop: 24 }]}>
@ -51,7 +64,7 @@ function Institution({ user, institutionRole }) {
</Text>
<View style={{ flexDirection: "row" }}>
<MaterialCommunityIcons name="bank" size={30} color={colors.primary} />
<Text style={styles.subText}>{user.institutionName}</Text>
<Text style={styles.subText}>{user.institution}</Text>
</View>
<Text style={[styles.label, { marginTop: 24 }]}>

Loading…
Cancel
Save