From 569af95fd49ddc8fc0762e9d1fedf90e1b19e1e9 Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Thu, 19 Aug 2021 16:06:45 -0300 Subject: [PATCH] Changing icons in sharing river data to new layout --- .../screens/RiverFloodSharingDataScreen.js | 100 +++++++----------- 1 file changed, 41 insertions(+), 59 deletions(-) diff --git a/src/app/screens/RiverFloodSharingDataScreen.js b/src/app/screens/RiverFloodSharingDataScreen.js index 48711f6..0c0601f 100644 --- a/src/app/screens/RiverFloodSharingDataScreen.js +++ b/src/app/screens/RiverFloodSharingDataScreen.js @@ -1,37 +1,27 @@ import React, { useEffect, useState, useContext } from "react"; -import { StyleSheet, View, TouchableOpacity, PixelRatio } from "react-native"; +import { StyleSheet, View } from "react-native"; import * as Yup from "yup"; -import { - Form, - FormPicker as Picker, - SubmitButton, - FormField, -} from "../components/forms"; +import { Form, SubmitButton, FormField } 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 { Text } from "react-native"; import colors from "../config/colors"; -import { TouchableNativeFeedback } from "react-native-gesture-handler"; import { insertRiverData } from "../database/databaseLoader"; import { showMessage } from "react-native-flash-message"; import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; import assets from "../config/assets"; -import { scaleDimsFromWidth, dimensions } from "../config/dimensions"; +import { dimensions } from "../config/dimensions"; import moment from "moment"; -import FormDatePicker from "../components/forms/FormDatePicker"; -import FormLocationPicker from "../components/forms/FormLocationPicker"; import { EventLocationContext } from "../context/EventLocationContext"; import PickEventDateLocation from "../components/PickEventDateLocation"; +import SvgLabeledButton from "../components/SvgLabeledButton"; const validationSchema = Yup.object().shape({ images: Yup.array(), description: Yup.string().label("Description"), }); -const borderWidth = 4; - function RiverFloodSharingDataScreen(props) { const [riverScale, setRiverScale] = useState(-1); @@ -48,8 +38,6 @@ function RiverFloodSharingDataScreen(props) { const [date, setDate] = useState(moment()); const [time, setTime] = useState(moment()); - const dims = { width: 105, height: 105 }; //scaleDimsFromWidth(80, 80, 26); - return ( - setRiverScale(0)}> - - {riverScale == 0 ? ( - - ) : ( - - )} - - - - setRiverScale(1)}> - {riverScale == 1 ? ( - - ) : ( - - )} - + setRiverScale(0)} + SvgImage={assets.riverLevel.Low} + label={"BAIXO"} + isToggle={riverScale == 0} + /> + + setRiverScale(1)} + SvgImage={assets.riverLevel.Normal} + label={"NORMAL"} + isToggle={riverScale == 1} + /> - setRiverScale(2)}> - - {riverScale == 2 ? ( - - ) : ( - - )} - - - - setRiverScale(3)}> - {riverScale == 3 ? ( - - ) : ( - - )} - + setRiverScale(2)} + SvgImage={assets.riverLevel.High} + label={"ALTO"} + isToggle={riverScale == 2} + /> + + setRiverScale(3)} + SvgImage={assets.riverLevel.High} + label={"INUNDAR"} + isToggle={riverScale == 3} + /> @@ -150,15 +132,15 @@ function RiverFloodSharingDataScreen(props) { navigation={props.navigation} /> - Comentário: + Comentário: - +