From 894c844e956f5722559631f5a5519e35b502d29d Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Thu, 11 Feb 2021 14:31:46 -0300 Subject: [PATCH] =?UTF-8?q?Rain=20form=20with=20"Descri=C3=A7=C3=A3o"=20fi?= =?UTF-8?q?eld.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/hooks/selectFromDB.js | 5 +++-- src/app/screens/RainSharingDataScreen.js | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/app/hooks/selectFromDB.js b/src/app/hooks/selectFromDB.js index ae8b255..30789bd 100644 --- a/src/app/hooks/selectFromDB.js +++ b/src/app/hooks/selectFromDB.js @@ -120,15 +120,16 @@ function parseRainLevel(row) { "Pancada de chuva", ]; const rainIdx = row["RainIdx"]; + return { ID: ++ID, - title: "Nível da chuva", + title: rainLevel[rainIdx], coordinate: { latitude: row["Latitude"], longitude: row["Longitude"] + displacement, }, image: custom_assets.rainLevel[rainIdx], - description: rainLevel[rainIdx], + description: row["Description"], }; } diff --git a/src/app/screens/RainSharingDataScreen.js b/src/app/screens/RainSharingDataScreen.js index cb72fe1..56d60d0 100644 --- a/src/app/screens/RainSharingDataScreen.js +++ b/src/app/screens/RainSharingDataScreen.js @@ -2,7 +2,12 @@ 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 { + Form, + FormPicker as Picker, + SubmitButton, + FormField, +} from "../components/forms"; import Screen from "../components/Screen"; import FormImagePicker from "../components/forms/FormImagePicker"; import useLocation from "../hooks/useLocation"; @@ -16,6 +21,7 @@ import assets from "../config/assets"; const validationSchema = Yup.object().shape({ images: Yup.array(), + description: Yup.string().label("Description"), }); const borderWidth = 4; @@ -150,6 +156,13 @@ function RainSharingDataScreen(props) { +