|
@ -2,11 +2,7 @@ import React, { useState } from "react"; |
|
|
import { StyleSheet, View, ScrollView } from "react-native"; |
|
|
import { StyleSheet, View, ScrollView } from "react-native"; |
|
|
import * as Yup from "yup"; |
|
|
import * as Yup from "yup"; |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
Form, |
|
|
|
|
|
FormPicker as Picker, |
|
|
|
|
|
SubmitButton, |
|
|
|
|
|
} from "../components/forms"; |
|
|
|
|
|
|
|
|
import { Form, FormPicker as Picker, SubmitButton } from "../components/forms"; |
|
|
import Screen from "../components/Screen"; |
|
|
import Screen from "../components/Screen"; |
|
|
import FormImagePicker from "../components/forms/FormImagePicker"; |
|
|
import FormImagePicker from "../components/forms/FormImagePicker"; |
|
|
import useLocation from "../hooks/useLocation"; |
|
|
import useLocation from "../hooks/useLocation"; |
|
@ -15,6 +11,7 @@ import colors from "../config/colors"; |
|
|
import { TouchableNativeFeedback } from "react-native-gesture-handler"; |
|
|
import { TouchableNativeFeedback } from "react-native-gesture-handler"; |
|
|
import { insertRainData } from "../database/databaseLoader"; |
|
|
import { insertRainData } from "../database/databaseLoader"; |
|
|
import { showMessage } from "react-native-flash-message"; |
|
|
import { showMessage } from "react-native-flash-message"; |
|
|
|
|
|
import { scaleDimsFromWidth } from "../config/dimensions"; |
|
|
|
|
|
|
|
|
const validationSchema = Yup.object().shape({ |
|
|
const validationSchema = Yup.object().shape({ |
|
|
images: Yup.array().min(1, "Por favor, selecione ao menos uma imagem"), |
|
|
images: Yup.array().min(1, "Por favor, selecione ao menos uma imagem"), |
|
@ -51,17 +48,14 @@ function RainSharingDataScreen(props) { |
|
|
duration: 1950, |
|
|
duration: 1950, |
|
|
icon: "success", |
|
|
icon: "success", |
|
|
type: "success", |
|
|
type: "success", |
|
|
onPress: () => { |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
onPress: () => {}, |
|
|
}); |
|
|
}); |
|
|
props.navigation.goBack(null); |
|
|
props.navigation.goBack(null); |
|
|
}} |
|
|
}} |
|
|
validationSchema={validationSchema} |
|
|
validationSchema={validationSchema} |
|
|
> |
|
|
> |
|
|
<View> |
|
|
<View> |
|
|
<View |
|
|
|
|
|
style={{ flexDirection: "row", justifyContent: "space-around" }} |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<View style={styles.imgs_row}> |
|
|
<TouchableNativeFeedback onPress={() => setRain(0)}> |
|
|
<TouchableNativeFeedback onPress={() => setRain(0)}> |
|
|
<View |
|
|
<View |
|
|
borderWidth={rain == 0 ? borderWidth : 0} |
|
|
borderWidth={rain == 0 ? borderWidth : 0} |
|
@ -97,14 +91,12 @@ function RainSharingDataScreen(props) { |
|
|
style={styles.floodingLogo} |
|
|
style={styles.floodingLogo} |
|
|
source={require("../assets/chuva_peq.png")} |
|
|
source={require("../assets/chuva_peq.png")} |
|
|
/> |
|
|
/> |
|
|
<Text style={styles.text}>Chuva{"\n"}moderada</Text> |
|
|
|
|
|
|
|
|
<Text style={styles.text}>Chuva moderada</Text> |
|
|
</View> |
|
|
</View> |
|
|
</TouchableNativeFeedback> |
|
|
</TouchableNativeFeedback> |
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
<View |
|
|
|
|
|
style={{ flexDirection: "row", justifyContent: "space-around" }} |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<View style={styles.imgs_row}> |
|
|
<TouchableNativeFeedback onPress={() => setRain(3)}> |
|
|
<TouchableNativeFeedback onPress={() => setRain(3)}> |
|
|
<View |
|
|
<View |
|
|
borderWidth={rain == 3 ? borderWidth : 0} |
|
|
borderWidth={rain == 3 ? borderWidth : 0} |
|
@ -127,7 +119,7 @@ function RainSharingDataScreen(props) { |
|
|
style={styles.floodingLogo} |
|
|
style={styles.floodingLogo} |
|
|
source={require("../assets/chuva_muito_forte.png")} |
|
|
source={require("../assets/chuva_muito_forte.png")} |
|
|
/> |
|
|
/> |
|
|
<Text style={styles.text}>Chuva muito{"\n"}forte</Text> |
|
|
|
|
|
|
|
|
<Text style={styles.text}>Chuva muito forte</Text> |
|
|
</View> |
|
|
</View> |
|
|
</TouchableNativeFeedback> |
|
|
</TouchableNativeFeedback> |
|
|
|
|
|
|
|
@ -140,7 +132,7 @@ function RainSharingDataScreen(props) { |
|
|
style={styles.floodingLogo} |
|
|
style={styles.floodingLogo} |
|
|
source={require("../assets/chuva_pancadas.png")} |
|
|
source={require("../assets/chuva_pancadas.png")} |
|
|
/> |
|
|
/> |
|
|
<Text style={styles.text}>Pancada de{"\n"}chuva</Text> |
|
|
|
|
|
|
|
|
<Text style={styles.text}>Pancada de chuva</Text> |
|
|
</View> |
|
|
</View> |
|
|
</TouchableNativeFeedback> |
|
|
</TouchableNativeFeedback> |
|
|
</View> |
|
|
</View> |
|
@ -154,6 +146,8 @@ function RainSharingDataScreen(props) { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const dims = scaleDimsFromWidth(85, 85, 25); |
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({ |
|
|
const styles = StyleSheet.create({ |
|
|
container: { |
|
|
container: { |
|
|
padding: 10, |
|
|
padding: 10, |
|
@ -164,11 +158,15 @@ const styles = StyleSheet.create({ |
|
|
borderStyle: "dotted", |
|
|
borderStyle: "dotted", |
|
|
borderColor: colors.primary, |
|
|
borderColor: colors.primary, |
|
|
alignItems: "center", |
|
|
alignItems: "center", |
|
|
width: 110, |
|
|
|
|
|
|
|
|
width: dims.width, |
|
|
}, |
|
|
}, |
|
|
floodingLogo: { |
|
|
floodingLogo: { |
|
|
width: 85, |
|
|
|
|
|
height: 85, |
|
|
|
|
|
|
|
|
width: dims.width * 0.8, |
|
|
|
|
|
height: dims.height * 0.8, |
|
|
|
|
|
}, |
|
|
|
|
|
imgs_row: { |
|
|
|
|
|
flexDirection: "row", |
|
|
|
|
|
justifyContent: "space-around", |
|
|
}, |
|
|
}, |
|
|
text: { |
|
|
text: { |
|
|
fontSize: 14, |
|
|
fontSize: 14, |
|
|