Browse Source

Fixing key prop error in AccountScreen

master
GabrielTrettel 3 years ago
parent
commit
248c642b1d
  1. 4
      src/app/navigation/AccountNavigator.js
  2. 23
      src/app/screens/AccountScreen.js

4
src/app/navigation/AccountNavigator.js

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import { createStackNavigator } from "@react-navigation/stack"; import { createStackNavigator } from "@react-navigation/stack";
import AccountScreen from "../screens/AccountScreen"; import AccountScreen from "../screens/AccountScreen";
import PluviometerRegisterScreen from '../screens/PluviometerRegisterScreen';
import PluviometerRegisterScreen from "../screens/PluviometerRegisterScreen";
import MapFormScreen from "../screens/MapFormScreen"; import MapFormScreen from "../screens/MapFormScreen";
import Abbout from "../screens/Abbout"; import Abbout from "../screens/Abbout";
import ActivateInstitution from "../screens/ActivateInstitution"; import ActivateInstitution from "../screens/ActivateInstitution";
@ -73,8 +73,6 @@ const AccountNavigator = () => (
}, },
}} }}
/> />
<Stack.Screen <Stack.Screen
name="FormMap" name="FormMap"
component={MapFormScreen} component={MapFormScreen}

23
src/app/screens/AccountScreen.js

@ -1,11 +1,5 @@
import React, { useContext } from "react"; import React, { useContext } from "react";
import {
Text,
Image,
View,
StyleSheet,
ScrollView,
} from "react-native";
import { Text, Image, View, StyleSheet, ScrollView } from "react-native";
import Screen from "../components/Screen"; import Screen from "../components/Screen";
import { AuthContext } from "../auth/context"; import { AuthContext } from "../auth/context";
import authStorage from "../auth/storage"; import authStorage from "../auth/storage";
@ -53,7 +47,16 @@ function ProfileItensList({ icon, IconProvider, title, onPress }) {
}} }}
> >
<IconProvider name={icon} size={18} color={colors.dark} /> <IconProvider name={icon} size={18} color={colors.dark} />
<Text style={{ fontSize: 16, marginLeft: 16 }}>{title}</Text>
<Text
style={{
fontSize: 16,
marginLeft: 16,
textTransform: "uppercase",
fontWeight: "500",
}}
>
{title}
</Text>
<View <View
style={{ style={{
alignItems: "flex-end", alignItems: "flex-end",
@ -126,7 +129,7 @@ function AccountScreen(props) {
{ {
icon: "trash-can", icon: "trash-can",
IconProvider: MaterialCommunityIcons, IconProvider: MaterialCommunityIcons,
title: "Desativar conta",
title: "DESATIVAR CONTA",
onPress: () => { onPress: () => {
console.log("7"); console.log("7");
}, },
@ -145,12 +148,14 @@ function AccountScreen(props) {
<View style={{ marginTop: 24 }}> <View style={{ marginTop: 24 }}>
{profileItems.map(({ icon, IconProvider, title, onPress }) => ( {profileItems.map(({ icon, IconProvider, title, onPress }) => (
<View key={title}>
<ProfileItensList <ProfileItensList
icon={icon} icon={icon}
IconProvider={IconProvider} IconProvider={IconProvider}
title={title} title={title}
onPress={onPress} onPress={onPress}
/> />
</View>
))} ))}
</View> </View>
</View> </View>

Loading…
Cancel
Save