diff --git a/src/app/components/MapMarker.js b/src/app/components/MapMarker.js index 852a489..9e51b1c 100644 --- a/src/app/components/MapMarker.js +++ b/src/app/components/MapMarker.js @@ -5,28 +5,33 @@ import colors from "../config/colors"; import assets from "../config/assets"; import { dimensions, screen_height, screen_width } from "../config/dimensions"; import { Svg, Image as ImageSvg } from "react-native-svg"; +import MapModal from "./MapModal"; const markerSize = 30; -export default function MapMarker({ - title, - image, - pictures, - coordinate, - description, - ...props -}) { - console.log(pictures); - const pictures_s = JSON.parse(pictures); +export default function MapMarker(props) { + const [isModalVisible, setIsModalVisible] = useState(false); + return ( - + - + - + + + + setIsModalVisible(!isModalVisible)} + > - {title} - {description} + {props.title} + {props.description} diff --git a/src/app/components/MapModal.js b/src/app/components/MapModal.js new file mode 100644 index 0000000..e1c8682 --- /dev/null +++ b/src/app/components/MapModal.js @@ -0,0 +1,65 @@ +import React, { Component } from "react"; +import { Modal, Text, TouchableOpacity, View, StyleSheet } from "react-native"; +import { screen_height, screen_width } from "../config/dimensions"; + +function MapModal({ isVisible, setIsVisible }) { + console.log(screen_width); + return ( + + { + alert("Modal has been closed."); + }} + > + + + + Hello World! + + { + setIsVisible(!isVisible); + }} + > + Hide Modal + + + + + + + ); +} + +const styles = StyleSheet.create({ + centeredView: { + flex: 1, + justifyContent: "flex-end", + alignItems: "center", + marginTop: 22, + }, + modalView: { + margin: 20, + width: screen_width, + height: screen_height * 0.4, + backgroundColor: "white", + borderTopLeftRadius: 10, + borderTopRightRadius: 10, + padding: 35, + marginBottom: 0, + alignItems: "center", + shadowColor: "#000", + shadowOffset: { + width: 0, + height: 2, + }, + shadowOpacity: 0.25, + shadowRadius: 4, + elevation: 5, + }, +}); + +export default MapModal;