diff --git a/src/app/components/MapModal.js b/src/app/components/MapModal.js
index 689c150..e3db450 100644
--- a/src/app/components/MapModal.js
+++ b/src/app/components/MapModal.js
@@ -6,7 +6,6 @@ import colors from "../config/colors";
import { showMessage } from "react-native-flash-message";
import { dimensions, screen_height } from "../config/dimensions";
import { Svg, Image as ImageSvg } from "react-native-svg";
-import { ScrollView } from "react-native-gesture-handler";
import PluviometerGraphics from "./PluviometerGraphics";
const chartHeight = screen_height * 0.3;
@@ -24,44 +23,52 @@ function notImplemented() {
});
}
-function topBar(setShowModal) {
+function topBar(props, setShowModal) {
return (
- notImplemented()}
- >
-
-
+
+
+ {props.title}
+
+
- notImplemented()}
- >
-
-
+
+ notImplemented()}
+ >
+
+
- setShowModal(null)}
- >
-
-
+ notImplemented()}
+ >
+
+
+
+ setShowModal(null)}
+ >
+
+
+
);
}
@@ -73,7 +80,7 @@ function iconTextRow(props) {
@@ -89,19 +96,23 @@ function iconImageRow(props) {
-
+ {props.pictures > 0 ? (
+
+ ) : (
+ Não há foto
+ )}
);
@@ -190,43 +201,59 @@ function componentBody(props) {
- {props.title}
-
{iconTextRow({ name: "map-marker", description: address })}
{iconTextRow({ name: "calendar", description: date })}
{iconTextRow({ name: "account", description: "Usuário ativo" })}
- {pictures.length > 0 && iconImageRow({ name: "camera", pic: pictures })}
+ {iconImageRow({ name: "camera", pic: pictures })}
);
}
+function userMessage(marker) {
+ if (marker.description == "") return <>>;
+
+ return (
+
+
+ Comentário:
+
+ {marker.description}
+
+ );
+}
+
function isPluviometer(name) {
return name === "pluviometer" || name === "officialPluviometer";
}
-function MapModal({showModal, setShowModal, markers}) {
+function MapModal({ showModal, setShowModal, markers }) {
var currentMarker = undefined;
if (markers && showModal != null && markers.has(showModal)) {
currentMarker = markers.get(showModal);
}
if (currentMarker != undefined && showModal != null) {
- return (
-
- {topBar(setShowModal)}
- {componentBody(currentMarker)}
- {isPluviometer(currentMarker.name) ? moreInfo(currentMarker) : null}
- {!isPluviometer(currentMarker.name) ? reviews(currentMarker) : null}
-
- );}
- else {
+ return (
+
+ {topBar(currentMarker, setShowModal)}
+
+ {componentBody(currentMarker)}
+ {isPluviometer(currentMarker.name) ? moreInfo(currentMarker) : null}
+ {/* {!isPluviometer(currentMarker.name) ? reviews(currentMarker) : null} */}
+ {userMessage(currentMarker)}
+
+
+ );
+ } else {
return null;
}
}
@@ -240,7 +267,6 @@ const styles = StyleSheet.create({
bodyTitle: {
fontWeight: "700",
fontSize: dimensions.text.secondary,
- marginBottom: 5,
},
bodyInfo: {
flexDirection: "column",
@@ -248,7 +274,7 @@ const styles = StyleSheet.create({
},
bodyIcon: {
alignSelf: "flex-start",
- marginHorizontal: 20,
+ marginRight: 20,
height: 53,
width: 53,
},
@@ -264,8 +290,10 @@ const styles = StyleSheet.create({
marginHorizontal: 10,
},
topBar: {
+ backgroundColor: colors.primary,
flexDirection: "row",
- alignSelf: "flex-end",
+ width: "100%",
+ alignItems: "center",
},
topBarIcon: {
margin: 10,