|
|
@ -40,115 +40,115 @@ function RainSharingDataScreen(props) { |
|
|
|
Chuva |
|
|
|
</Text> |
|
|
|
<ScrollView style={styles.container}> |
|
|
|
<Form |
|
|
|
initialValues={{ |
|
|
|
images: [], |
|
|
|
}} |
|
|
|
onSubmit={(values) => { |
|
|
|
insertRainData({ ...values, rain, location }); |
|
|
|
showMessage({ |
|
|
|
message: "Informação enviada!", |
|
|
|
duration: 1950, |
|
|
|
icon: "success", |
|
|
|
type: "success", |
|
|
|
onPress: () => { |
|
|
|
}, |
|
|
|
}); |
|
|
|
props.navigation.goBack(null); |
|
|
|
}} |
|
|
|
validationSchema={validationSchema} |
|
|
|
> |
|
|
|
<View> |
|
|
|
<View |
|
|
|
style={{ flexDirection: "row", justifyContent: "space-around" }} |
|
|
|
> |
|
|
|
<TouchableNativeFeedback onPress={() => setRain(0)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 0 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/sem_chuva.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Sem chuva</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
<Form |
|
|
|
initialValues={{ |
|
|
|
images: [], |
|
|
|
}} |
|
|
|
onSubmit={(values) => { |
|
|
|
insertRainData({ ...values, rain, location }); |
|
|
|
showMessage({ |
|
|
|
message: "Informação enviada!", |
|
|
|
duration: 1950, |
|
|
|
icon: "success", |
|
|
|
type: "success", |
|
|
|
onPress: () => { |
|
|
|
}, |
|
|
|
}); |
|
|
|
props.navigation.goBack(null); |
|
|
|
}} |
|
|
|
validationSchema={validationSchema} |
|
|
|
> |
|
|
|
<View> |
|
|
|
<View |
|
|
|
style={{ flexDirection: "row", justifyContent: "space-around" }} |
|
|
|
> |
|
|
|
<TouchableNativeFeedback onPress={() => setRain(0)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 0 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/sem_chuva.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Sem chuva</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
|
|
|
|
<TouchableNativeFeedback onPress={() => setRain(1)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 1 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_peq.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Chuva fraca</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
<TouchableNativeFeedback onPress={() => setRain(1)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 1 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_fraca.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Chuva fraca</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
|
|
|
|
<TouchableNativeFeedback onPress={() => setRain(2)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 2 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_peq.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Chuva{"\n"}moderada</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
</View> |
|
|
|
<TouchableNativeFeedback onPress={() => setRain(2)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 2 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_peq.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Chuva{"\n"}moderada</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
</View> |
|
|
|
|
|
|
|
<View |
|
|
|
style={{ flexDirection: "row", justifyContent: "space-around" }} |
|
|
|
> |
|
|
|
<TouchableNativeFeedback onPress={() => setRain(3)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 3 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_forte.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Chuva forte</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
<View |
|
|
|
style={{ flexDirection: "row", justifyContent: "space-around" }} |
|
|
|
> |
|
|
|
<TouchableNativeFeedback onPress={() => setRain(3)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 3 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_forte.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Chuva forte</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
|
|
|
|
<TouchableNativeFeedback onPress={() => setRain(4)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 4 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_muito_forte.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Chuva muito{"\n"}forte</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
<TouchableNativeFeedback onPress={() => setRain(4)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 4 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_muito_forte.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Chuva muito{"\n"}forte</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
|
|
|
|
<TouchableNativeFeedback onPress={() => setRain(5)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 5 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_pancadas.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Pancada de{"\n"}chuva</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
<TouchableNativeFeedback onPress={() => setRain(5)}> |
|
|
|
<View |
|
|
|
borderWidth={rain == 5 ? borderWidth : 0} |
|
|
|
style={styles.img_block} |
|
|
|
> |
|
|
|
<Image |
|
|
|
style={styles.floodingLogo} |
|
|
|
source={require("../assets/chuva_pancadas.png")} |
|
|
|
/> |
|
|
|
<Text style={styles.text}>Pancada de{"\n"}chuva</Text> |
|
|
|
</View> |
|
|
|
</TouchableNativeFeedback> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
</View> |
|
|
|
<FormImagePicker backgroundColor="#1976D2" name="images" /> |
|
|
|
<FormImagePicker backgroundColor="#1976D2" name="images" /> |
|
|
|
|
|
|
|
<SubmitButton title="Enviar" backgroundColor={colors.primary} /> |
|
|
|
</Form> |
|
|
|
<SubmitButton title="Enviar" backgroundColor={colors.primary} /> |
|
|
|
</Form> |
|
|
|
</ScrollView> |
|
|
|
</Screen> |
|
|
|
); |
|
|
@ -156,7 +156,7 @@ function RainSharingDataScreen(props) { |
|
|
|
|
|
|
|
const styles = StyleSheet.create({ |
|
|
|
container: { |
|
|
|
paddingHorizontal: 10, |
|
|
|
padding: 10, |
|
|
|
}, |
|
|
|
img_block: { |
|
|
|
borderRadius: 5, |
|
|
|