Browse Source

Fixing spacing and default message when institution type is "Nenhuma"

master
GabrielTrettel 3 years ago
parent
commit
65ca9aa9dd
  1. 58
      src/app/screens/PluviometerRegisterScreen.js

58
src/app/screens/PluviometerRegisterScreen.js

@ -2,8 +2,7 @@ import React, { useState, useContext } from "react";
import { MaterialIcons } from "@expo/vector-icons";
import { StyleSheet, Text, View } from "react-native";
import { Form, SubmitButton } from "../components/forms";
import { showMessage } from "react-native-flash-message";
import { dimensions, scaleDimsFromWidth } from "../config/dimensions";
import { dimensions } from "../config/dimensions";
import FormDatePicker from "../components/forms/FormDatePicker";
import colors from "../config/colors/";
import moment from "moment";
@ -16,7 +15,6 @@ import { AssembleIngestionPluvRegistration } from "../components/forms/AssembleI
import OnSubmitAwaitModal from "../components/forms/OnSubmitAwaitModal";
import OnSubmitMessageModal from "../components/forms/OnSubmitMessageModal";
const dims = scaleDimsFromWidth(85, 85, 25);
function Institution({ user }) {
const institutionMap = {
@ -24,11 +22,11 @@ function Institution({ user }) {
D: "Defesa Civil",
N: "Não governamental",
O: "Outra",
N: "Nenhuma",
X: "Nenhuma",
};
return (
<View style={{ marginBottom: 24, flex: 1 }}>
<View style={{ marginBottom: 24 }}>
<Text style={styles.labelTipoInst}>Tipo de instituição: </Text>
<View style={{ flexDirection: "row", marginTop: 16 }}>
<FontAwesome5 name="university" size={30} color={colors.primary} />
@ -133,7 +131,7 @@ function PluvDateTimePicker({
pluviometer,
}) {
return (
<View style={{ flex: 1 }}>
<View style={{height: 58}}>
{!pluviometer && (
<FormDatePicker
onDateChange={onDateChange}
@ -218,16 +216,15 @@ function PluviometerRegisterScreen(props) {
<View
style={{
padding: 6,
flex: 1,
flexDirection: "column",
justifyContent: "space-evenly",
}}
>
<View style={{ flex: 0.05 }}>
<Text style={styles.title}>{user.pluviometer? "Dados do Pluviômetro" : "Cadastro do Pluviômetro"}</Text>
</View>
<View style={{ flex: 0.95, justifyContent: "space-between" }}>
<View style={{ flex: 0.19 }}>
<Text style={styles.title}>
{user.pluviometer
? "Dados do Pluviômetro"
: "Cadastro do Pluviômetro"}
</Text>
<Text
style={{
marginTop: 24,
@ -249,11 +246,11 @@ function PluviometerRegisterScreen(props) {
formTypeFace={"pluviometerRegister"}
pluviometer={user.pluviometer}
/>
</View>
<View style={{ flex: 0.19 }}>
<Text style={styles.label}>Endereço do pluviômetro*: </Text>
<View marginBottom={24}>
<View marginBottom={24} marginTop={12}>
<LocationPicker
navigation={props.navigation}
location={location}
@ -262,33 +259,19 @@ function PluviometerRegisterScreen(props) {
pluviometer={user.pluviometer}
/>
</View>
</View>
<View style={{ flex: 0.38 }}>
<Institution user={user} />
</View>
<View style={{ flex: 0.19 }}>
{!user.pluviometer && (
<SubmitButton
style={{ alignSelf: "" }}
title="Cadastrar"
paddingHorizontal={0}
/>
<SubmitButton title="Cadastrar" paddingHorizontal={0} />
)}
</View>
</View>
</View>
</Form>
</View>
);
}
const styles = StyleSheet.create({
image: {
width: dims.width * 0.8,
height: dims.height * 0.8,
justifyContent: "center",
alignItems: "center",
},
label: {
fontSize: dimensions.text.secondary,
marginBottom: 12,
@ -316,17 +299,12 @@ const styles = StyleSheet.create({
fontWeight: "500",
},
title: {
// marginVertical: 24,
fontSize: 18,
fontWeight: "bold",
textAlign: "center",
color: colors.primary,
},
date: {
paddingLeft: 12,
flexDirection: "column",
justifyContent: "center",
},
});
export default PluviometerRegisterScreen;
Loading…
Cancel
Save