|
@ -28,8 +28,8 @@ function Institution({ user }) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<View style={{ marginBottom: 24 }}> |
|
|
|
|
|
<Text style={styles.label}>Tipo de instituição: </Text> |
|
|
|
|
|
|
|
|
<View style={{ marginBottom: 24, flex: 1 }}> |
|
|
|
|
|
<Text style={styles.labelTipoInst}>Tipo de instituição: </Text> |
|
|
<View style={{ flexDirection: "row", marginTop: 16 }}> |
|
|
<View style={{ flexDirection: "row", marginTop: 16 }}> |
|
|
<FontAwesome5 name="university" size={30} color={colors.primary} /> |
|
|
<FontAwesome5 name="university" size={30} color={colors.primary} /> |
|
|
<Text style={styles.subText}> |
|
|
<Text style={styles.subText}> |
|
@ -74,7 +74,9 @@ function LocationPicker({ |
|
|
{pluviometer && ( |
|
|
{pluviometer && ( |
|
|
<View style={{ flexDirection: "row", marginTop: 16 }}> |
|
|
<View style={{ flexDirection: "row", marginTop: 16 }}> |
|
|
<Text style={styles.subText}> |
|
|
<Text style={styles.subText}> |
|
|
{pluviometer?.address ? pluviometer.address : "Erro ao carregar endereço"} |
|
|
|
|
|
|
|
|
{pluviometer.address |
|
|
|
|
|
? pluviometer.address |
|
|
|
|
|
: "Erro ao carregar endereço"} |
|
|
</Text> |
|
|
</Text> |
|
|
</View> |
|
|
</View> |
|
|
)} |
|
|
)} |
|
@ -141,11 +143,13 @@ function PluvDateTimePicker({ |
|
|
formTypeFace={formTypeFace} |
|
|
formTypeFace={formTypeFace} |
|
|
/> |
|
|
/> |
|
|
)} |
|
|
)} |
|
|
|
|
|
|
|
|
{pluviometer && ( |
|
|
{pluviometer && ( |
|
|
<View |
|
|
<View |
|
|
style={{ |
|
|
style={{ |
|
|
flexDirection: "row", |
|
|
flexDirection: "row", |
|
|
alignItems: "center", |
|
|
alignItems: "center", |
|
|
|
|
|
alignContent: "center", |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<MaterialCommunityIcons |
|
|
<MaterialCommunityIcons |
|
@ -153,9 +157,11 @@ function PluvDateTimePicker({ |
|
|
size={30} |
|
|
size={30} |
|
|
color={colors.primary} |
|
|
color={colors.primary} |
|
|
/> |
|
|
/> |
|
|
<View style={{ flexDirection: "row", marginTop: 16 }}> |
|
|
|
|
|
<Text style={styles.subText}> |
|
|
|
|
|
{pluviometer.regiterDate ? pluviometer.regiterDate : "Erro ao carregar a data"} |
|
|
|
|
|
|
|
|
<View style={styles.date}> |
|
|
|
|
|
<Text style={styles.subTextDate}> |
|
|
|
|
|
{pluviometer.regiterDate |
|
|
|
|
|
? pluviometer.regiterDate |
|
|
|
|
|
: "Erro ao carregar a data"} |
|
|
</Text> |
|
|
</Text> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
@ -209,51 +215,66 @@ function PluviometerRegisterScreen(props) { |
|
|
}); |
|
|
}); |
|
|
}} |
|
|
}} |
|
|
> |
|
|
> |
|
|
<View style={{ padding: 6, flex: 1, flexDirection:"column" }}> |
|
|
|
|
|
<Text style={styles.title}>Cadastro do Pluviômetro</Text> |
|
|
|
|
|
<View style={{flex: 0.25}}> |
|
|
|
|
|
<Text |
|
|
|
|
|
style={{ |
|
|
|
|
|
marginTop: 24, |
|
|
|
|
|
marginBottom: 16, |
|
|
|
|
|
fontSize: dimensions.text.secondary, |
|
|
|
|
|
fontWeight: "bold", |
|
|
|
|
|
textAlign: "left", |
|
|
|
|
|
color: colors.secondary, |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Data do cadastro: |
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
|
|
|
|
<PluvDateTimePicker |
|
|
|
|
|
onDateChange={(value) => setDate(value)} |
|
|
|
|
|
onTimeChange={(value) => setTime(value)} |
|
|
|
|
|
date={date} |
|
|
|
|
|
time={time} |
|
|
|
|
|
formTypeFace={"pluviometerRegister"} |
|
|
|
|
|
pluviometer={user.pluviometer} |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<View |
|
|
|
|
|
style={{ |
|
|
|
|
|
padding: 6, |
|
|
|
|
|
flex: 1, |
|
|
|
|
|
flexDirection: "column", |
|
|
|
|
|
justifyContent: "space-evenly", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<View style={{ flex: 0.05 }}> |
|
|
|
|
|
<Text style={styles.title}>Cadastro do Pluviômetro</Text> |
|
|
</View> |
|
|
</View> |
|
|
<View style={{flex: 0.25}}> |
|
|
|
|
|
<Text style={styles.label}>Endereço do pluviômetro*: </Text> |
|
|
|
|
|
|
|
|
<View style={{ flex: 0.95, justifyContent: "space-between" }}> |
|
|
|
|
|
<View style={{ flex: 0.19 }}> |
|
|
|
|
|
<Text |
|
|
|
|
|
style={{ |
|
|
|
|
|
marginTop: 24, |
|
|
|
|
|
marginBottom: 16, |
|
|
|
|
|
fontSize: dimensions.text.secondary, |
|
|
|
|
|
fontWeight: "bold", |
|
|
|
|
|
textAlign: "left", |
|
|
|
|
|
color: colors.secondary, |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Data do cadastro: |
|
|
|
|
|
</Text> |
|
|
|
|
|
|
|
|
<View marginBottom={24}> |
|
|
|
|
|
<LocationPicker |
|
|
|
|
|
navigation={props.navigation} |
|
|
|
|
|
location={location} |
|
|
|
|
|
setLocationAddr={setLocationAddr} |
|
|
|
|
|
setGeoLocation={setCoordinates} |
|
|
|
|
|
|
|
|
<PluvDateTimePicker |
|
|
|
|
|
onDateChange={(value) => setDate(value)} |
|
|
|
|
|
onTimeChange={(value) => setTime(value)} |
|
|
|
|
|
date={date} |
|
|
|
|
|
time={time} |
|
|
|
|
|
formTypeFace={"pluviometerRegister"} |
|
|
pluviometer={user.pluviometer} |
|
|
pluviometer={user.pluviometer} |
|
|
/> |
|
|
/> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
<View style={{flex: 0.25}}> |
|
|
|
|
|
<Institution user={user} /> |
|
|
|
|
|
</View> |
|
|
|
|
|
<View style={{flex: 0.25}}> |
|
|
|
|
|
{!user.pluviometer && ( |
|
|
|
|
|
<SubmitButton title="Cadastrar" paddingHorizontal={0} /> |
|
|
|
|
|
)} |
|
|
|
|
|
|
|
|
<View style={{ flex: 0.19 }}> |
|
|
|
|
|
<Text style={styles.label}>Endereço do pluviômetro*: </Text> |
|
|
|
|
|
|
|
|
|
|
|
<View marginBottom={24}> |
|
|
|
|
|
<LocationPicker |
|
|
|
|
|
navigation={props.navigation} |
|
|
|
|
|
location={location} |
|
|
|
|
|
setLocationAddr={setLocationAddr} |
|
|
|
|
|
setGeoLocation={setCoordinates} |
|
|
|
|
|
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} |
|
|
|
|
|
/> |
|
|
|
|
|
)} |
|
|
|
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</Form> |
|
|
</Form> |
|
@ -275,6 +296,12 @@ const styles = StyleSheet.create({ |
|
|
textAlign: "left", |
|
|
textAlign: "left", |
|
|
color: colors.secondary, |
|
|
color: colors.secondary, |
|
|
}, |
|
|
}, |
|
|
|
|
|
labelTipoInst: { |
|
|
|
|
|
fontSize: dimensions.text.secondary, |
|
|
|
|
|
fontWeight: "bold", |
|
|
|
|
|
textAlign: "left", |
|
|
|
|
|
color: colors.secondary, |
|
|
|
|
|
}, |
|
|
subText: { |
|
|
subText: { |
|
|
color: colors.subText, |
|
|
color: colors.subText, |
|
|
fontSize: 16, |
|
|
fontSize: 16, |
|
@ -282,8 +309,14 @@ const styles = StyleSheet.create({ |
|
|
fontWeight: "500", |
|
|
fontWeight: "500", |
|
|
paddingLeft: 16, |
|
|
paddingLeft: 16, |
|
|
}, |
|
|
}, |
|
|
|
|
|
subTextDate: { |
|
|
|
|
|
color: colors.subText, |
|
|
|
|
|
fontSize: 16, |
|
|
|
|
|
alignSelf: "center", |
|
|
|
|
|
fontWeight: "500", |
|
|
|
|
|
}, |
|
|
title: { |
|
|
title: { |
|
|
marginVertical: 24, |
|
|
|
|
|
|
|
|
// marginVertical: 24,
|
|
|
fontSize: 18, |
|
|
fontSize: 18, |
|
|
fontWeight: "bold", |
|
|
fontWeight: "bold", |
|
|
textAlign: "center", |
|
|
textAlign: "center", |
|
|