diff --git a/src/app/screens/PluviometerSharingDataScreen.js b/src/app/screens/PluviometerSharingDataScreen.js index d6672c3..3c5e595 100644 --- a/src/app/screens/PluviometerSharingDataScreen.js +++ b/src/app/screens/PluviometerSharingDataScreen.js @@ -1,5 +1,6 @@ import React, { useState } from "react"; -import { StyleSheet } from "react-native"; + +import { StyleSheet, Text, View, Image } from "react-native"; import * as Yup from "yup"; import { @@ -8,16 +9,13 @@ import { FormPicker as Picker, SubmitButton, } from "../components/forms"; -import CategoryPickerItem from "../components/CategoryPickerItem"; import Screen from "../components/Screen"; import DatePicker from 'react-native-datepicker'; import useLocation from "../hooks/useLocation"; +import FormImagePicker from "../components/forms/FormImagePicker"; const validationSchema = Yup.object().shape({ - title: Yup.string().required().min(1).label("Title"), - price: Yup.number().required().min(1).max(10000).label("Price"), - description: Yup.string().label("Description"), - category: Yup.object().required().nullable().label("Category"), + pluviometer: Yup.number().required().min(1).max(10000).label("pluviometer"), images: Yup.array().min(1, "Please select at least one image."), }); @@ -25,56 +23,78 @@ const validationSchema = Yup.object().shape({ function PluviometerSharingDataScreen() { const location = useLocation(); - const [date, setDate] = useState('09-10-2020'); + var day = new Date().getDate(); + var month = new Date().getMonth() + 1; + var year = new Date().getFullYear(); + + var currentDate = day + '/' + month + '/' + year + + const [date, setDate] = useState(currentDate); + return ( + + + Pluviômetro + +
console.log(location)} - validationSchema={validationSchema} - > - - { - setDate(date); - }} - /> - - + validationSchema={validationSchema}> + + Quantidade de chuva: + + + + + Data da coleta: + { + setDate(date); + }} + /> + + + +
); @@ -82,8 +102,18 @@ function PluviometerSharingDataScreen() { const styles = StyleSheet.create({ container: { - padding: 10, + paddingHorizontal: 10, }, -}); + image: { + width: 85, + height: 85, + justifyContent: "center", + alignItems: "center", + + }, + datePickerStyle: { + width: 180, + } +}) export default PluviometerSharingDataScreen; diff --git a/src/app/screens/SharingDataScreen.js b/src/app/screens/SharingDataScreen.js index ae52954..bdb5e5b 100644 --- a/src/app/screens/SharingDataScreen.js +++ b/src/app/screens/SharingDataScreen.js @@ -5,6 +5,7 @@ import { Image, Text, TouchableOpacity } from "react-native"; import { createStackNavigator } from "@react-navigation/stack"; import RainSharingDataScreen from "../screens/RainSharingDataScreen"; import SharingFloodZonesScreen from "./SharingFloodZonesScreen"; +import PluviometerSharingDataScreen from "./PluviometerSharingDataScreen"; //1/3 @@ -46,7 +47,7 @@ function SharingDataScreen({ navigation }) { - + navigation.navigate('PluviometerSharingData')}> + ); }