|
@ -24,7 +24,7 @@ function notImplemented() { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function topBar(setMarkerToRender) { |
|
|
|
|
|
|
|
|
function topBar(setShowModal) { |
|
|
return ( |
|
|
return ( |
|
|
<View style={styles.topBar}> |
|
|
<View style={styles.topBar}> |
|
|
<TouchableOpacity |
|
|
<TouchableOpacity |
|
@ -53,7 +53,7 @@ function topBar(setMarkerToRender) { |
|
|
|
|
|
|
|
|
<TouchableOpacity |
|
|
<TouchableOpacity |
|
|
style={styles.topBarIcon} |
|
|
style={styles.topBarIcon} |
|
|
onPress={() => setMarkerToRender(null)} |
|
|
|
|
|
|
|
|
onPress={() => setShowModal(null)} |
|
|
> |
|
|
> |
|
|
<MaterialCommunityIcons |
|
|
<MaterialCommunityIcons |
|
|
name="close" |
|
|
name="close" |
|
@ -205,21 +205,21 @@ function isPluviometer(name) { |
|
|
return name === "pluviometer" || name === "officialPluviometer"; |
|
|
return name === "pluviometer" || name === "officialPluviometer"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function MapModal({markerToRender, setMarkerToRender, markers}) { |
|
|
|
|
|
|
|
|
function MapModal({showModal, setShowModal, markers}) { |
|
|
var currentMarker = undefined; |
|
|
var currentMarker = undefined; |
|
|
if (markers && markerToRender != null && markers.has(markerToRender)) { |
|
|
|
|
|
currentMarker = markers.get(markerToRender); |
|
|
|
|
|
|
|
|
if (markers && showModal != null && markers.has(showModal)) { |
|
|
|
|
|
currentMarker = markers.get(showModal); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (currentMarker != undefined && markerToRender != null) { |
|
|
|
|
|
|
|
|
if (currentMarker != undefined && showModal != null) { |
|
|
return ( |
|
|
return ( |
|
|
<SelfClosingModal |
|
|
<SelfClosingModal |
|
|
animationType="slide" |
|
|
animationType="slide" |
|
|
transparent={true} |
|
|
transparent={true} |
|
|
markerToRender={markerToRender} |
|
|
|
|
|
setMarkerToRender={setMarkerToRender} |
|
|
|
|
|
|
|
|
showModal={showModal} |
|
|
|
|
|
setShowModal={setShowModal} |
|
|
> |
|
|
> |
|
|
{topBar(setMarkerToRender)} |
|
|
|
|
|
|
|
|
{topBar(setShowModal)} |
|
|
{componentBody(currentMarker)} |
|
|
{componentBody(currentMarker)} |
|
|
{isPluviometer(currentMarker.name) ? moreInfo(currentMarker) : null} |
|
|
{isPluviometer(currentMarker.name) ? moreInfo(currentMarker) : null} |
|
|
{!isPluviometer(currentMarker.name) ? reviews(currentMarker) : null} |
|
|
{!isPluviometer(currentMarker.name) ? reviews(currentMarker) : null} |
|
|