From d27681de37329981a5e0f10922da814e5c0f23ba Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Tue, 23 Nov 2021 20:41:07 -0300 Subject: [PATCH] Implementing warning for not allowing getLocation --- src/app/screens/MapFeedScreen.js | 59 +++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/src/app/screens/MapFeedScreen.js b/src/app/screens/MapFeedScreen.js index 4e2b053..a2bf2f2 100644 --- a/src/app/screens/MapFeedScreen.js +++ b/src/app/screens/MapFeedScreen.js @@ -5,6 +5,33 @@ import attachFocusToQuery from "../hooks/useFocus"; import HeaderBarMenu from "../components/HeaderBarMenu"; import useSocketMarkers from "../hooks/useSocketMarkers"; import LoadingMarkersModal from "../components/LoadingMarkersModal"; +import colors from "../config/colors"; +import {dimensions} from "../config/dimensions"; +import { MaterialCommunityIcons } from "@expo/vector-icons"; + +function NoLocationProvided() { + return ( + + + Localização não fornecida{"\n"} + Para utilizar as funcionalidades do mapa é preciso ativar a localização + + ); +} export default function MapFeedScreen(props) { HeaderBarMenu(props.navigation); @@ -21,29 +48,22 @@ export default function MapFeedScreen(props) { floodZones: false, riverFlood: false, }, - }); + }); const markers = useSocketMarkers(); - console.log("============= qtd markers " + markers.markers.size + " ================" ) - // console.log("location: " + JSON.stringify(global.location)) - return ( - (global.location) ? ( + return global.location ? ( - + /> + - ):( - - Apresentar um erro no futuro - - ) + ) : ( + ); } @@ -52,4 +72,17 @@ const styles = StyleSheet.create({ flex: 1, backgroundColor: "#FFF", }, + txtHeader: { + color: colors.primary, + fontSize: dimensions.text.header, + fontWeight: "bold", + textAlign: "center", + paddingTop: 12, + paddingBottom: 20, + }, + txtStyle: { + fontSize: dimensions.text.secondary, + fontWeight: "bold", + textAlign: "center", + }, });