import React, { useState } from "react"; import { StyleSheet, View } 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 } from "react-native"; import colors from "../config/colors"; import { TouchableNativeFeedback } from "react-native-gesture-handler"; import { insertRiverData } from "../database/databaseLoader"; const validationSchema = Yup.object().shape({ images: Yup.array().min(1, "Por favor, selecione ao menos uma imagem"), }); const borderWidth = 4; function RiverFloodSharingDataScreen(props) { const [riverScale, setRiverScale] = useState(0); const location = useLocation(); return ( Nível da água do rio
{ insertRiverData({ ...values, riverScale, location }); props.navigation.goBack(null); }} validationSchema={validationSchema} > setRiverScale(0)}> Baixo setRiverScale(1)}> Rio normal setRiverScale(2)}> Alto setRiverScale(3)}> Transbordando props.navigation.pop()} />
); } const styles = StyleSheet.create({ container: { padding: 10, }, img_block: { borderRadius: 5, padding: 10, borderStyle: "dotted", borderColor: colors.primary, alignItems: "center", width: 130, }, floodingLogo: { width: 85, height: 85, }, text: { fontSize: 14, textAlign: "center", marginTop: 10, }, }); export default RiverFloodSharingDataScreen;