Skip to content

Commit

Permalink
share fix
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmorley15 committed Aug 18, 2024
1 parent d1a49b7 commit 2dc3ac3
Showing 1 changed file with 24 additions and 29 deletions.
53 changes: 24 additions & 29 deletions frontend/src/lib/components/AdventureModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
lngLat: { lng: adventure.longitude, lat: adventure.latitude },
location: adventure.location || '',
name: adventure.name,
activity_type: '',
lng: 0
activity_type: ''
}
];
}
Expand Down Expand Up @@ -213,8 +212,7 @@
lngLat: { lng: longitude, lat: latitude },
location: data[0]?.display_name || '',
name: data[0]?.name || '',
activity_type: data[0]?.type || '',
lng: 0
activity_type: data[0]?.type || ''
}
];
}
Expand Down Expand Up @@ -249,6 +247,7 @@
let data = await res.json();
if (data.extract?.length > 0) {
adventure.description = data.extract;
wikiError = '';
} else {
wikiError = 'No description found';
}
Expand All @@ -262,8 +261,7 @@
lngLat: e.detail.lngLat,
name: '',
location: '',
activity_type: '',
lng: 0
activity_type: ''
}
];
console.log(markers);
Expand Down Expand Up @@ -550,8 +548,7 @@
lngLat: { lng: Number(place.lon), lat: Number(place.lat) },
location: place.display_name,
name: place.name,
activity_type: place.type,
lng: 0
activity_type: place.type
}
];
}}
Expand Down Expand Up @@ -586,27 +583,6 @@ it would also work to just use on:click on the MapLibre component itself. -->
<button type="submit" class="btn btn-primary">Save & Next</button>
<button type="button" class="btn" on:click={close}>Close</button>
</div>
{#if adventure.is_public}
<div class="bg-neutral p-4 mt-2 rounded-md shadow-sm">
<p class=" font-semibold">Share this Adventure!</p>
<div class="flex items-center justify-between">
<p class="text-card-foreground font-mono">
{window.location.origin}/adventures/{adventure.id}
</p>
<button
type="button"
on:click={() => {
navigator.clipboard.writeText(
`${window.location.origin}/adventures/${adventure.id}`
);
}}
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 h-10 px-4 py-2"
>
Copy Link
</button>
</div>
</div>
{/if}
</div>
</form>
</div>
Expand Down Expand Up @@ -685,5 +661,24 @@ it would also work to just use on:click on the MapLibre component itself. -->
<button type="button" class="btn btn-primary" on:click={saveAndClose}>Close</button>
</div>
{/if}
{#if adventure.is_public && adventure.id}
<div class="bg-neutral p-4 mt-2 rounded-md shadow-sm">
<p class=" font-semibold">Share this Adventure!</p>
<div class="flex items-center justify-between">
<p class="text-card-foreground font-mono">
{window.location.origin}/adventures/{adventure.id}
</p>
<button
type="button"
on:click={() => {
navigator.clipboard.writeText(`${window.location.origin}/adventures/${adventure.id}`);
}}
class="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 h-10 px-4 py-2"
>
Copy Link
</button>
</div>
</div>
{/if}
</div>
</dialog>

0 comments on commit 2dc3ac3

Please sign in to comment.