import React, { useState } from "react"; import { Button, StyleSheet, View } from "react-native"; import * as Yup from "yup"; import { Form, FormField, FormPicker as Picker, SubmitButton, } from "../components/forms"; import CategoryPickerItem from "../components/CategoryPickerItem"; 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"; const validationSchema = Yup.object().shape({ images: Yup.array().min(1, "Por favor, selecione ao menos uma imagem"), }); const borderWidth = 4; function RainSharingDataScreen() { const [rain, setRain] = useState(0); const location = useLocation(); return ( Chuva
{ insertRainData({ ...values, rain, location }); props.navigation.goBack(null); }} validationSchema={validationSchema} > setRain(0)}> Sem chuva setRain(1)}> Chuva fraca setRain(2)}> Chuva{"\n"}moderada setRain(3)}> Chuva forte setRain(4)}> Chuva muito{"\n"}forte setRain(5)}> Pancada de{"\n"}chuva
); } const styles = StyleSheet.create({ container: { paddingHorizontal: 10, }, img_block: { borderRadius: 5, padding: 10, borderStyle: "dotted", borderColor: colors.primary, alignItems: "center", width: 110, }, floodingLogo: { width: 85, height: 85, }, text: { fontSize: 14, textAlign: "center", marginTop: 10, }, }); export default RainSharingDataScreen;