|
|
@ -16,12 +16,24 @@ import { AssembleIngestionPluvRegistration } from "../components/forms/AssembleI |
|
|
|
const dims = scaleDimsFromWidth(85, 85, 25); |
|
|
|
|
|
|
|
function Institution({ user }) { |
|
|
|
const 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={{ marginBottom: 24 }}> |
|
|
|
<Text style={styles.label}>Tipo de instituição: </Text> |
|
|
|
<View style={{ flexDirection: "row", marginTop: 16 }}> |
|
|
|
<FontAwesome5 name="university" size={30} color={colors.primary} /> |
|
|
|
<Text style={styles.subText}>{user.institutionType}</Text> |
|
|
|
<Text style={styles.subText}> |
|
|
|
{user.institutiontype |
|
|
|
? institutionMap[user.institutiontype] |
|
|
|
: "Tipo de instituição não informado"} |
|
|
|
</Text> |
|
|
|
</View> |
|
|
|
|
|
|
|
<Text style={[styles.label, { marginTop: 24 }]}> |
|
|
@ -29,7 +41,11 @@ function Institution({ user }) { |
|
|
|
</Text> |
|
|
|
<View style={{ flexDirection: "row" }}> |
|
|
|
<FontAwesome5 name="university" size={30} color={colors.primary} /> |
|
|
|
<Text style={styles.subText}>{user.institutionName}</Text> |
|
|
|
<Text style={styles.subText}> |
|
|
|
{user.institution |
|
|
|
? user.institution |
|
|
|
: "Nome da instituição não informado"} |
|
|
|
</Text> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
); |
|
|
@ -127,59 +143,52 @@ function PluviometerRegisterScreen(props) { |
|
|
|
}); |
|
|
|
|
|
|
|
props.navigation.navigate("Home"); |
|
|
|
} |
|
|
|
else{ |
|
|
|
} else { |
|
|
|
showMessage({ |
|
|
|
message: "Erro ao cadastrar pluviômetro. Por favor, tente mais tarde!", |
|
|
|
message: |
|
|
|
"Erro ao cadastrar pluviômetro. Por favor, tente mais tarde!", |
|
|
|
duration: 1950, |
|
|
|
icon: "danger", |
|
|
|
type: "danger", |
|
|
|
onPress: () => {}, |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}} |
|
|
|
> |
|
|
|
<View padding={16}> |
|
|
|
<Text style={styles.title}>Cadastro do Pluviômetro</Text> |
|
|
|
<View> |
|
|
|
<Text |
|
|
|
style={{ |
|
|
|
marginTop: 24, |
|
|
|
marginBottom: 16, |
|
|
|
fontSize: dimensions.text.secondary, |
|
|
|
fontWeight: "bold", |
|
|
|
textAlign: "left", |
|
|
|
color: colors.secondary, |
|
|
|
}} |
|
|
|
> |
|
|
|
Data do cadastro:{" "} |
|
|
|
</Text> |
|
|
|
{/* <Text */} |
|
|
|
{/* style={{ */} |
|
|
|
{/* marginTop: 24, */} |
|
|
|
{/* marginBottom: 16, */} |
|
|
|
{/* fontSize: dimensions.text.secondary, */} |
|
|
|
{/* fontWeight: "bold", */} |
|
|
|
{/* textAlign: "left", */} |
|
|
|
{/* color: colors.secondary, */} |
|
|
|
{/* }} */} |
|
|
|
{/* > */} |
|
|
|
{/* Data do cadastro: */} |
|
|
|
{/* </Text> */} |
|
|
|
|
|
|
|
<View |
|
|
|
style={{ |
|
|
|
marginBottom: 24, |
|
|
|
}} |
|
|
|
> |
|
|
|
<FormDatePicker |
|
|
|
onDateChange={(value) => setDate(value)} |
|
|
|
onTimeChange={(value) => setTime(value)} |
|
|
|
date={date} |
|
|
|
time={time} |
|
|
|
formTypeFace={"pluviometerRegister"} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
{/* <FormDatePicker */} |
|
|
|
{/* onDateChange={(value) => setDate(value)} */} |
|
|
|
{/* onTimeChange={(value) => setTime(value)} */} |
|
|
|
{/* date={date} */} |
|
|
|
{/* time={time} */} |
|
|
|
{/* formTypeFace={"pluviometerRegister"} */} |
|
|
|
{/* /> */} |
|
|
|
<Text style={styles.label}>Endereço do pluviômetro*: </Text> |
|
|
|
<LocationPicker |
|
|
|
navigation={props.navigation} |
|
|
|
location={location} |
|
|
|
setLocationAddr={setLocationAddr} |
|
|
|
setGeoLocation={setCoordinates} |
|
|
|
/> |
|
|
|
|
|
|
|
{user.institutionType && <Institution user={user} />} |
|
|
|
<View marginBottom={24}> |
|
|
|
<LocationPicker |
|
|
|
navigation={props.navigation} |
|
|
|
location={location} |
|
|
|
setLocationAddr={setLocationAddr} |
|
|
|
setGeoLocation={setCoordinates} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
|
|
|
|
<Institution user={user} /> |
|
|
|
<SubmitButton title="Cadastrar" paddingHorizontal={0} /> |
|
|
|
</View> |
|
|
|
</Form> |
|
|
@ -209,6 +218,7 @@ const styles = StyleSheet.create({ |
|
|
|
paddingLeft: 16, |
|
|
|
}, |
|
|
|
title: { |
|
|
|
marginVertical: 24, |
|
|
|
fontSize: 18, |
|
|
|
fontWeight: "bold", |
|
|
|
textAlign: "center", |
|
|
|