|
@ -48,7 +48,7 @@ function RiverFloodSharingDataScreen(props) { |
|
|
const [date, setDate] = useState(moment()); |
|
|
const [date, setDate] = useState(moment()); |
|
|
const [time, setTime] = useState(moment()); |
|
|
const [time, setTime] = useState(moment()); |
|
|
|
|
|
|
|
|
const dims = scaleDimsFromWidth(80, 80, 20); |
|
|
|
|
|
|
|
|
const dims = { width: 105, height: 105 }; //scaleDimsFromWidth(80, 80, 26);
|
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Screen style={styles.container}> |
|
|
<Screen style={styles.container}> |
|
@ -66,7 +66,14 @@ function RiverFloodSharingDataScreen(props) { |
|
|
setError(true); |
|
|
setError(true); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
insertRiverData({ ...values, riverScale, location, date, time, address }); |
|
|
|
|
|
|
|
|
insertRiverData({ |
|
|
|
|
|
...values, |
|
|
|
|
|
riverScale, |
|
|
|
|
|
location, |
|
|
|
|
|
date, |
|
|
|
|
|
time, |
|
|
|
|
|
address, |
|
|
|
|
|
}); |
|
|
showMessage({ |
|
|
showMessage({ |
|
|
message: "Informação enviada!", |
|
|
message: "Informação enviada!", |
|
|
duration: 1950, |
|
|
duration: 1950, |
|
@ -77,10 +84,21 @@ function RiverFloodSharingDataScreen(props) { |
|
|
}} |
|
|
}} |
|
|
validationSchema={validationSchema} |
|
|
validationSchema={validationSchema} |
|
|
> |
|
|
> |
|
|
<View style={{paddingHorizontal: 16}}> |
|
|
|
|
|
|
|
|
<View |
|
|
|
|
|
style={{ |
|
|
|
|
|
paddingHorizontal: 16, |
|
|
|
|
|
paddingTop: 16, |
|
|
|
|
|
flexDirection: "column", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<View |
|
|
|
|
|
flexDirection="row" |
|
|
|
|
|
justifyContent="center" |
|
|
|
|
|
paddingBottom={16} |
|
|
|
|
|
> |
|
|
<View style={styles.imgs_row}> |
|
|
<View style={styles.imgs_row}> |
|
|
<TouchableNativeFeedback onPress={() => setRiverScale(0)}> |
|
|
<TouchableNativeFeedback onPress={() => setRiverScale(0)}> |
|
|
<View style={styles.img_block}> |
|
|
|
|
|
|
|
|
<View style={{ paddingRight: 16 }}> |
|
|
{riverScale == 0 ? ( |
|
|
{riverScale == 0 ? ( |
|
|
<assets.riverLevel.LowToggle {...dims} /> |
|
|
<assets.riverLevel.LowToggle {...dims} /> |
|
|
) : ( |
|
|
) : ( |
|
@ -90,17 +108,18 @@ function RiverFloodSharingDataScreen(props) { |
|
|
</TouchableNativeFeedback> |
|
|
</TouchableNativeFeedback> |
|
|
|
|
|
|
|
|
<TouchableNativeFeedback onPress={() => setRiverScale(1)}> |
|
|
<TouchableNativeFeedback onPress={() => setRiverScale(1)}> |
|
|
<View style={styles.img_block}> |
|
|
|
|
|
{riverScale == 1 ? ( |
|
|
{riverScale == 1 ? ( |
|
|
<assets.riverLevel.NormalToggle {...dims} /> |
|
|
<assets.riverLevel.NormalToggle {...dims} /> |
|
|
) : ( |
|
|
) : ( |
|
|
<assets.riverLevel.Normal {...dims} /> |
|
|
<assets.riverLevel.Normal {...dims} /> |
|
|
)} |
|
|
)} |
|
|
</View> |
|
|
|
|
|
</TouchableNativeFeedback> |
|
|
</TouchableNativeFeedback> |
|
|
|
|
|
</View> |
|
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
<View flexDirection="row" justifyContent="center"> |
|
|
<TouchableNativeFeedback onPress={() => setRiverScale(2)}> |
|
|
<TouchableNativeFeedback onPress={() => setRiverScale(2)}> |
|
|
<View style={styles.img_block}> |
|
|
|
|
|
|
|
|
<View style={{ paddingRight: 16 }}> |
|
|
{riverScale == 2 ? ( |
|
|
{riverScale == 2 ? ( |
|
|
<assets.riverLevel.HighToggle {...dims} /> |
|
|
<assets.riverLevel.HighToggle {...dims} /> |
|
|
) : ( |
|
|
) : ( |
|
@ -110,13 +129,11 @@ function RiverFloodSharingDataScreen(props) { |
|
|
</TouchableNativeFeedback> |
|
|
</TouchableNativeFeedback> |
|
|
|
|
|
|
|
|
<TouchableNativeFeedback onPress={() => setRiverScale(3)}> |
|
|
<TouchableNativeFeedback onPress={() => setRiverScale(3)}> |
|
|
<View style={styles.img_block}> |
|
|
|
|
|
{riverScale == 3 ? ( |
|
|
{riverScale == 3 ? ( |
|
|
<assets.riverLevel.FloodingToggle {...dims} /> |
|
|
<assets.riverLevel.FloodingToggle {...dims} /> |
|
|
) : ( |
|
|
) : ( |
|
|
<assets.riverLevel.Flooding {...dims} /> |
|
|
<assets.riverLevel.Flooding {...dims} /> |
|
|
)} |
|
|
)} |
|
|
</View> |
|
|
|
|
|
</TouchableNativeFeedback> |
|
|
</TouchableNativeFeedback> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
@ -126,13 +143,15 @@ function RiverFloodSharingDataScreen(props) { |
|
|
)} |
|
|
)} |
|
|
|
|
|
|
|
|
<FormImagePicker backgroundColor={colors.primary} name="images" /> |
|
|
<FormImagePicker backgroundColor={colors.primary} name="images" /> |
|
|
|
|
|
|
|
|
<PickEventDateLocation |
|
|
<PickEventDateLocation |
|
|
setDate={setDate} |
|
|
setDate={setDate} |
|
|
setTime={setTime} |
|
|
setTime={setTime} |
|
|
navigation={props.navigation}/> |
|
|
|
|
|
|
|
|
navigation={props.navigation} |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<View style={{ flex: 1 }}> |
|
|
|
|
|
<Text style={styles.labelStyle}>Comentário:</Text> |
|
|
<Text style={styles.labelStyle}>Comentário:</Text> |
|
|
|
|
|
|
|
|
<FormField |
|
|
<FormField |
|
|
maxLength={255} |
|
|
maxLength={255} |
|
|
multiline |
|
|
multiline |
|
@ -140,8 +159,10 @@ function RiverFloodSharingDataScreen(props) { |
|
|
numberOfLines={3} |
|
|
numberOfLines={3} |
|
|
placeholder="Escreva um comentário (Opcional)..." |
|
|
placeholder="Escreva um comentário (Opcional)..." |
|
|
/> |
|
|
/> |
|
|
</View> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<View paddingVertical={24}> |
|
|
<SubmitButton title="Enviar" backgroundColor={colors.primary} /> |
|
|
<SubmitButton title="Enviar" backgroundColor={colors.primary} /> |
|
|
|
|
|
</View> |
|
|
</Form> |
|
|
</Form> |
|
|
</KeyboardAwareScrollView> |
|
|
</KeyboardAwareScrollView> |
|
|
</Screen> |
|
|
</Screen> |
|
@ -152,13 +173,6 @@ const styles = StyleSheet.create({ |
|
|
container: { |
|
|
container: { |
|
|
backgroundColor: colors.white, |
|
|
backgroundColor: colors.white, |
|
|
}, |
|
|
}, |
|
|
img_block: { |
|
|
|
|
|
borderRadius: 5, |
|
|
|
|
|
borderStyle: "dotted", |
|
|
|
|
|
borderColor: colors.white, |
|
|
|
|
|
borderWidth: borderWidth, |
|
|
|
|
|
alignItems: "center", |
|
|
|
|
|
}, |
|
|
|
|
|
imgs_row: { |
|
|
imgs_row: { |
|
|
flexDirection: "row", |
|
|
flexDirection: "row", |
|
|
justifyContent: "space-between", |
|
|
justifyContent: "space-between", |
|
@ -169,6 +183,8 @@ const styles = StyleSheet.create({ |
|
|
}, |
|
|
}, |
|
|
labelStyle: { |
|
|
labelStyle: { |
|
|
paddingHorizontal: 16, |
|
|
paddingHorizontal: 16, |
|
|
|
|
|
paddingTop: 24, |
|
|
|
|
|
paddingBottom: 12, |
|
|
fontSize: dimensions.text.secondary, |
|
|
fontSize: dimensions.text.secondary, |
|
|
fontWeight: "bold", |
|
|
fontWeight: "bold", |
|
|
textAlign: "left", |
|
|
textAlign: "left", |
|
|