Skip to content

Commit

Permalink
feat: add Google maps link to maps view
Browse files Browse the repository at this point in the history
  • Loading branch information
SchutteJan committed Sep 14, 2024
1 parent 979b3a6 commit 812d394
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions frontend/src/lib/MapBarItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { user } from '$lib/stores'
import Checkmark from './Checkmark.svelte'
import { visitBar, deleteVisit } from '../api/bars'
import Externallink from './Externallink.svelte'
export let bar: LocationResponse
export let onVisitCallback: CallableFunction
Expand Down Expand Up @@ -35,17 +36,26 @@
<h4 class="title">{bar.name}</h4>
<p class="area">{bar.area_name}</p>

{#if isLoggedIn}
<div>
<div>
<a
class="maps-link"
target="_blank"
href="https://www.google.com/maps/search/?api=1&query={encodeURIComponent(
bar.address_line
)}&query_place_id={bar.google_place_id}"
>Maps <Externallink />
</a>

{#if isLoggedIn}
{#if bar.visited_at}
<button on:click={handleDeleteBarVisit} class="hidden-button"
><span class="checkmark"><Checkmark /></span></button
>
{:else}
<button on:click={handleVisitBar} class="visit-button outline">Check in</button>
{/if}
</div>
{/if}
{/if}
</div>
</div>

<style>
Expand All @@ -65,5 +75,9 @@
all: unset;
display: inline-block;
cursor: pointer;
vertical-align: middle;
}
.maps-link {
font-size: 12pt;
}
</style>

0 comments on commit 812d394

Please sign in to comment.