diff --git a/src/app/components/MapModal.js b/src/app/components/MapModal.js
index 570f874..787aef3 100644
--- a/src/app/components/MapModal.js
+++ b/src/app/components/MapModal.js
@@ -26,12 +26,25 @@ function notImplemented() {
});
}
-function topBar(props, setShowModal) {
+function loadingData() {
+ return (
+
+ Carregando dados...
+
+ );
+}
+
+function onCloseModal(setShowModal, setCurrentMarker) {
+ setShowModal(null);
+ setCurrentMarker(undefined);
+}
+
+function topBar(props, setShowModal, setCurrentMarker) {
return (
- {props.title}
+ {props ? props.title : "Aguarde..."}
@@ -62,7 +75,7 @@ function topBar(props, setShowModal) {
setShowModal(null)}
+ onPress={() => onCloseModal(setShowModal, setCurrentMarker)}
>
onCloseModal(setShowModal, setCurrentMarker)}
>
- {topBar(currentMarker, setShowModal)}
-
- {componentBody(currentMarker)}
- {isPluviometer(currentMarker.name) ? moreInfo(currentMarker) : null}
- {/* {!isPluviometer(currentMarker.name) ? reviews(currentMarker) : null} */}
- {userMessage(currentMarker)}
-
+ {topBar(currentMarker, setShowModal, setCurrentMarker)}
+
+ {currentMarker != undefined && (
+
+
+ {componentBody(currentMarker)}
+ {isPluviometer(currentMarker.name)
+ ? moreInfo(currentMarker)
+ : null}
+ {/* {!isPluviometer(currentMarker.name) ? reviews(currentMarker) : null} */}
+ {userMessage(currentMarker)}
+
+
+ )}
+ {currentMarker == undefined && (
+
+
+
+
+ Aguarde um momento enquanto os dados são carregados
+
+
+
+ )}
);
} else {
@@ -338,6 +376,13 @@ const styles = StyleSheet.create({
fontWeight: "500",
fontSize: dimensions.text.default,
},
+ textWait: {
+ fontSize: dimensions.text.secondary,
+ textAlign: "center",
+ color: colors.primary,
+ fontWeight: "bold",
+ paddingBottom: dimensions.spacing.big_padding,
+ },
});
export default MapModal;