Skip to content

Commit

Permalink
add / to linkpath if it doesn't start with /, and some linting
Browse files Browse the repository at this point in the history
  • Loading branch information
K committed Nov 23, 2024
1 parent 6d8af9b commit fdf4694
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions nr-app/src/components/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ const NoteMarker = ({
for (const tag of tags) {
if (tag[0] === "linkPath") {
// todo use layerKey to get the correct domain
return "https://hitchwiki.org" + tag[1];
const path = tag[1];
const formattedPath = path.startsWith("/") ? path : "/" + path;
return "https://hitchwiki.org" + formattedPath;
}
}
return null;
Expand All @@ -91,17 +93,13 @@ const NoteMarker = ({

return (
<Marker coordinate={coordinates} pinColor={pinColor}>
<Callout onPress={() =>
Linking.openURL(urlFromTags(event.event.tags, layerKey))
}>

<Callout
onPress={() => Linking.openURL(urlFromTags(event.event.tags, layerKey))}
>
<View style={styles.marker}>
<Text>
{`${new Date(event.event.created_at * 1000).toLocaleString()} ${event.event.content} `}
<Text
style={{ color: "blue" }}

>
<Text style={{ color: "blue" }}>
{urlFromTags(event.event.tags, layerKey)}
</Text>
</Text>
Expand Down

0 comments on commit fdf4694

Please sign in to comment.