From cd99b4b0f081e2f8ca0c4c64f8d0cc177ad879e0 Mon Sep 17 00:00:00 2001 From: analuizaff Date: Tue, 15 Dec 2020 12:09:09 -0300 Subject: [PATCH] Navigation to RainSharingDataScreen and FloodSharingDataScreen --- src/App.js | 5 +- .../screens/PluviometerSharingDataScreen.js | 89 +++++++++++++++++++ src/app/screens/SharingDataScreen.js | 7 +- 3 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 src/app/screens/PluviometerSharingDataScreen.js diff --git a/src/App.js b/src/App.js index e2112b9..0338add 100644 --- a/src/App.js +++ b/src/App.js @@ -9,14 +9,17 @@ import openDatabase from "./app/database/database-connection"; import SharingFloodZonesScreen from "./app/screens/SharingFloodZonesScreen"; import initDatabase from "./app/database/database-init"; import RainSharingDataScreen from "./app/screens/RainSharingDataScreen"; +import RainSharingDataNavigator from "./app/navigation/RainSharingDataNavigator"; +import PluviometerSharingDataScreen from "./app/screens/PluviometerSharingDataScreen"; export default function App() { global.userDataBase = openDatabase(); initDatabase(global.userDataBase); return ( - // + // // + // diff --git a/src/app/screens/PluviometerSharingDataScreen.js b/src/app/screens/PluviometerSharingDataScreen.js new file mode 100644 index 0000000..d6672c3 --- /dev/null +++ b/src/app/screens/PluviometerSharingDataScreen.js @@ -0,0 +1,89 @@ +import React, { useState } from "react"; +import { StyleSheet } 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 DatePicker from 'react-native-datepicker'; +import useLocation from "../hooks/useLocation"; + +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"), + images: Yup.array().min(1, "Please select at least one image."), +}); + + +function PluviometerSharingDataScreen() { + const location = useLocation(); + + const [date, setDate] = useState('09-10-2020'); + + return ( + +
console.log(location)} + validationSchema={validationSchema} + > + + { + setDate(date); + }} + /> + + + +
+ ); +} + +const styles = StyleSheet.create({ + container: { + padding: 10, + }, +}); + +export default PluviometerSharingDataScreen; diff --git a/src/app/screens/SharingDataScreen.js b/src/app/screens/SharingDataScreen.js index 5229375..a4ab318 100644 --- a/src/app/screens/SharingDataScreen.js +++ b/src/app/screens/SharingDataScreen.js @@ -4,11 +4,11 @@ import { StyleSheet, View } from "react-native"; import { Image, Text, TouchableOpacity } from 'react-native'; import { createStackNavigator } from "@react-navigation/stack"; import RainSharingDataScreen from '../screens/RainSharingDataScreen'; +import SharingFloodZonesScreen from "./SharingFloodZonesScreen"; //1/3 const styles = StyleSheet.create({ container: { - paddingTop: 50, }, rainLogo: { width: 110, @@ -30,7 +30,7 @@ function SharingDataScreen({ navigation }) { - + navigation.navigate('FloodSharingData')}> + ); } -export default RainSharingDataNavigator; +export default RainSharingDataNavigator; \ No newline at end of file