import React, { useState } from "react"; import { StyleSheet, View, ScrollView } from "react-native"; import * as Yup from "yup"; import { Form, FormPicker as Picker, SubmitButton } from "../components/forms"; import Screen from "../components/Screen"; import FormImagePicker from "../components/forms/FormImagePicker"; import useLocation from "../hooks/useLocation"; import { Image, Text, TouchableOpacity } from "react-native"; import colors from "../config/colors"; import { TouchableNativeFeedback } from "react-native-gesture-handler"; import { insertRainData } from "../database/databaseLoader"; import { showMessage } from "react-native-flash-message"; import { scaleDimsFromWidth } from "../config/dimensions"; import assets from "../config/assets"; const validationSchema = Yup.object().shape({ images: Yup.array().min(1, "Por favor, selecione ao menos uma imagem"), }); const borderWidth = 4; function RainSharingDataScreen(props) { const [rain, setRain] = useState(0); const location = useLocation(); return ( Chuva
{ insertRainData({ ...values, rain, location }); showMessage({ message: "Informação enviada!", duration: 1950, icon: "success", type: "success", onPress: () => {}, }); props.navigation.goBack(null); }} validationSchema={validationSchema} > setRain(0)}> Sem chuva setRain(1)}> Chuva fraca setRain(2)}> Chuva moderada setRain(3)}> Chuva forte setRain(4)}> Chuva muito forte setRain(5)}> Pancada de chuva
); } const dims = scaleDimsFromWidth(85, 85, 25); const styles = StyleSheet.create({ container: { padding: 10, backgroundColor: colors.white, }, img_block: { borderRadius: 5, padding: 10, borderStyle: "dotted", borderColor: colors.white, borderWidth: borderWidth, alignItems: "center", width: dims.width, }, floodingLogo: { width: dims.width * 0.8, height: dims.height * 0.8, }, imgs_row: { flexDirection: "row", justifyContent: "space-around", }, text: { fontSize: 14, textAlign: "center", marginTop: 10, }, }); export default RainSharingDataScreen;