Browse Source

pluviometer screen inputs as required fields

master
analuizaff 4 years ago
parent
commit
a62fde6c07
  1. 2
      src/app/navigation/SharingDataOptionsNavigator.js
  2. 4
      src/app/screens/PluviometerSharingDataScreen.js

2
src/app/navigation/SharingDataOptionsNavigator.js

@ -15,7 +15,7 @@ function SharingDataOptionsNavigator() {
return ( return (
<Stack.Navigator initialRouteName="SharingData"> <Stack.Navigator initialRouteName="SharingData">
<Stack.Screen <Stack.Screen
name="appNavigator"
name="Voltar"
component={AppNavigator} component={AppNavigator}
options={{ options={{
headerShown: false headerShown: false

4
src/app/screens/PluviometerSharingDataScreen.js

@ -40,7 +40,7 @@ const validationSchema = Yup.object().shape({
.min(0, "O valor deve ser maior ou igual a 0.") .min(0, "O valor deve ser maior ou igual a 0.")
.max(10000) .max(10000)
.label("pluviometer"), .label("pluviometer"),
data: Yup.string().min(1, "Por favor preencha a data"),
data: Yup.string().required("Campo obrigatório. Por favor, selecione a data"),
images: Yup.array(), images: Yup.array(),
}); });
@ -121,7 +121,6 @@ function PluviometerSharingDataScreen(props) {
> >
<View style={{ marginTop: 30, flex: 1 }}> <View style={{ marginTop: 30, flex: 1 }}>
<Text style={styles.labelStyle}>Quantidade de chuva:</Text> <Text style={styles.labelStyle}>Quantidade de chuva:</Text>
<View style={{ flex: 1, flexDirection: "row" }}>
<FormField <FormField
keyboardType="number-pad" keyboardType="number-pad"
maxLength={200} maxLength={200}
@ -129,7 +128,6 @@ function PluviometerSharingDataScreen(props) {
placeholder="Digite a quantidade de chuva" placeholder="Digite a quantidade de chuva"
/> />
</View> </View>
</View>
<View style={{ marginTop: 10, flex: 1, borderRadius: 25 }}> <View style={{ marginTop: 10, flex: 1, borderRadius: 25 }}>
<Text style={styles.labelStyle}>Data da coleta:</Text> <Text style={styles.labelStyle}>Data da coleta:</Text>

Loading…
Cancel
Save