From 69d4fb89985496db66e305c2b1c9e3800f71cc6e Mon Sep 17 00:00:00 2001 From: GabrielTrettel Date: Fri, 12 Feb 2021 17:22:30 -0300 Subject: [PATCH] Improving MapMarker layout --- src/app/components/MapMarker.js | 62 +++++++++++++++++++++------------ src/app/config/dimensions.js | 5 +++ 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/src/app/components/MapMarker.js b/src/app/components/MapMarker.js index ebecc0b..852a489 100644 --- a/src/app/components/MapMarker.js +++ b/src/app/components/MapMarker.js @@ -16,24 +16,17 @@ export default function MapMarker({ ...props }) { console.log(pictures); + const pictures_s = JSON.parse(pictures); return ( - + - {"Título: \t" + title} - {"Descrição: \t" + description} - - - + {title} + {description} @@ -43,17 +36,26 @@ export default function MapMarker({ } const styles = StyleSheet.create({ + title: { + fontWeight: "bold", + fontSize: dimensions.text.secondary, + alignSelf: "center", + paddingBottom: dimensions.spacing.minimal_padding, + }, + description: { + fontSize: dimensions.text.default, + }, arrow: { alignSelf: "center", - borderTopWidth: 20, - borderRightWidth: 20, + borderTopWidth: 15, + borderRightWidth: 10, borderBottomWidth: 0, - borderLeftWidth: 20, + borderLeftWidth: 10, borderTopColor: colors.lightGray, borderRightColor: "transparent", borderBottomColor: "transparent", borderLeftColor: "transparent", - paddingBottom: 8, + paddingBottom: 5, }, container: { @@ -62,18 +64,32 @@ const styles = StyleSheet.create({ backgroundColor: colors.lightestGray, borderColor: colors.lightGray, borderRadius: 6, - borderWidth: 2, - borderBottomWidth: 4, - borderRightWidth: 4, - padding: 15, - height: 200, + borderWidth: 4, + borderTopWidth: 2, + padding: dimensions.spacing.minimal_padding, + width: 200, }, markerPoint: { alignSelf: "center", height: markerSize, width: markerSize, }, - title: { - fontWeight: "400", - }, }); + +/* + * NOTE: Code for displaying images inside MapMarker. Leaved here for possible + * future needs + * + * + * {pictures_s.length > 0 && ( + * + * + * + * )} + * + */ diff --git a/src/app/config/dimensions.js b/src/app/config/dimensions.js index 79a2a6c..9b5f45e 100644 --- a/src/app/config/dimensions.js +++ b/src/app/config/dimensions.js @@ -10,6 +10,11 @@ const dimensions = { default: 16, tertiary: 12, }, + + spacing: { + normal_padding: 10, + minimal_padding: 5, + }, }; /* imageScaleToSize (iw, ih, scale_w)