From e2d015eb66615f6849f8d648befeee145b7a073a Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Thu, 19 Aug 2021 16:54:00 -0300 Subject: [PATCH 1/3] Weather forecast screen adjusted when error occours --- src/app/api/weather_forecast.js | 2 +- src/app/screens/ForecastScreen.js | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/app/api/weather_forecast.js b/src/app/api/weather_forecast.js index 0e600e2..a332448 100644 --- a/src/app/api/weather_forecast.js +++ b/src/app/api/weather_forecast.js @@ -28,7 +28,7 @@ function getWeatherForecast() { rain_fall_mm: 0, }, { - week_day: " Terça ", + week_day: "Terça", date: "20/03", weather_index: 2, rain_fall_mm: 5, diff --git a/src/app/screens/ForecastScreen.js b/src/app/screens/ForecastScreen.js index 2f0492d..4eed66d 100644 --- a/src/app/screens/ForecastScreen.js +++ b/src/app/screens/ForecastScreen.js @@ -114,7 +114,6 @@ function renderTodayForecast(forecast) { ); } -// FIXME: The border line must be in full wcreen width. function border() { return ( - Previsão do tempo não disponível no momento + Ops, algo deu errado... + + Não conseguimos encontrar a previsão do tempo para sua localização + + ); } From fc47bebb7138496a810d4bf2bdf84badf35a1c5a Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Mon, 23 Aug 2021 12:54:02 -0300 Subject: [PATCH 2/3] Refactoring old code for reusability purposes --- src/app/components/MapModal.js | 18 +++++++++--------- src/app/components/SelfClosingModal.js | 4 ++-- src/app/components/map/OpenStreetMap.js | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/app/components/MapModal.js b/src/app/components/MapModal.js index c3a1c67..087fd27 100644 --- a/src/app/components/MapModal.js +++ b/src/app/components/MapModal.js @@ -24,7 +24,7 @@ function notImplemented() { }); } -function topBar(setMarkerToRender) { +function topBar(setShowModal) { return ( setMarkerToRender(null)} + onPress={() => setShowModal(null)} > - {topBar(setMarkerToRender)} + {topBar(setShowModal)} {componentBody(currentMarker)} {isPluviometer(currentMarker.name) ? moreInfo(currentMarker) : null} {!isPluviometer(currentMarker.name) ? reviews(currentMarker) : null} diff --git a/src/app/components/SelfClosingModal.js b/src/app/components/SelfClosingModal.js index 3819d98..23801db 100644 --- a/src/app/components/SelfClosingModal.js +++ b/src/app/components/SelfClosingModal.js @@ -14,10 +14,10 @@ export default function SelfClosingModal(props) { props.setMarkerToRender(null)} + onPress={() => props.setShowModal(null)} > diff --git a/src/app/components/map/OpenStreetMap.js b/src/app/components/map/OpenStreetMap.js index ebd3fe1..99c8e1a 100644 --- a/src/app/components/map/OpenStreetMap.js +++ b/src/app/components/map/OpenStreetMap.js @@ -83,8 +83,8 @@ export default function OpenStreetMap({ )} From 190f9489810fd7e8267f6fe3bf27099ae2c70d75 Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Mon, 23 Aug 2021 15:40:10 -0300 Subject: [PATCH 3/3] Starting to implement data filter modal --- src/app/components/MapDataMenu.js | 142 ++++++++++++++++++++++++ src/app/components/map/OpenStreetMap.js | 2 + src/app/config/colors.js | 2 +- 3 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 src/app/components/MapDataMenu.js diff --git a/src/app/components/MapDataMenu.js b/src/app/components/MapDataMenu.js new file mode 100644 index 0000000..787e61f --- /dev/null +++ b/src/app/components/MapDataMenu.js @@ -0,0 +1,142 @@ +import React, { useState } from "react"; + +import { View, StyleSheet, Text, Button, TouchableOpacity } from "react-native"; +import SelfClosingModal from "./SelfClosingModal"; +import colors from "../config/colors"; +import { FontAwesome5 } from '@expo/vector-icons'; +import { MaterialIcons } from "@expo/vector-icons"; +import { MaterialCommunityIcons } from "@expo/vector-icons"; +import { Shadow } from "react-native-shadow-2"; + +function DataMenuHeader({ setShowModal }) { + return ( + + DADOS + + setShowModal(null)} + > + + + + ); +} + +function DataOriginSelector() { + const [dataOriginToShow, setDataOriginToShow] = useState("oficial") + const bgToUse = (selected) => dataOriginToShow == selected ? colors.secondary : colors.gray; + + return ( + + + setDataOriginToShow("oficial")} + > + + OFICIAL + + + + setDataOriginToShow("citzen")} + > + + CIDADÃO + + + + ); +} + +function DataMenuBody({ setShowModal }) { + return ( + + + + + ); +} + +export default function MapDataMenu(props) { + const [showModal, setShowModal] = useState(null); + return ( + +