mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-22 22:39:36 +02:00
share fix
This commit is contained in:
parent
d1a49b7dd9
commit
2dc3ac3aa3
1 changed files with 24 additions and 29 deletions
|
@ -59,8 +59,7 @@
|
||||||
lngLat: { lng: adventure.longitude, lat: adventure.latitude },
|
lngLat: { lng: adventure.longitude, lat: adventure.latitude },
|
||||||
location: adventure.location || '',
|
location: adventure.location || '',
|
||||||
name: adventure.name,
|
name: adventure.name,
|
||||||
activity_type: '',
|
activity_type: ''
|
||||||
lng: 0
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -213,8 +212,7 @@
|
||||||
lngLat: { lng: longitude, lat: latitude },
|
lngLat: { lng: longitude, lat: latitude },
|
||||||
location: data[0]?.display_name || '',
|
location: data[0]?.display_name || '',
|
||||||
name: data[0]?.name || '',
|
name: data[0]?.name || '',
|
||||||
activity_type: data[0]?.type || '',
|
activity_type: data[0]?.type || ''
|
||||||
lng: 0
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -249,6 +247,7 @@
|
||||||
let data = await res.json();
|
let data = await res.json();
|
||||||
if (data.extract?.length > 0) {
|
if (data.extract?.length > 0) {
|
||||||
adventure.description = data.extract;
|
adventure.description = data.extract;
|
||||||
|
wikiError = '';
|
||||||
} else {
|
} else {
|
||||||
wikiError = 'No description found';
|
wikiError = 'No description found';
|
||||||
}
|
}
|
||||||
|
@ -262,8 +261,7 @@
|
||||||
lngLat: e.detail.lngLat,
|
lngLat: e.detail.lngLat,
|
||||||
name: '',
|
name: '',
|
||||||
location: '',
|
location: '',
|
||||||
activity_type: '',
|
activity_type: ''
|
||||||
lng: 0
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
console.log(markers);
|
console.log(markers);
|
||||||
|
@ -550,8 +548,7 @@
|
||||||
lngLat: { lng: Number(place.lon), lat: Number(place.lat) },
|
lngLat: { lng: Number(place.lon), lat: Number(place.lat) },
|
||||||
location: place.display_name,
|
location: place.display_name,
|
||||||
name: place.name,
|
name: place.name,
|
||||||
activity_type: place.type,
|
activity_type: place.type
|
||||||
lng: 0
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}}
|
}}
|
||||||
|
@ -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="submit" class="btn btn-primary">Save & Next</button>
|
||||||
<button type="button" class="btn" on:click={close}>Close</button>
|
<button type="button" class="btn" on:click={close}>Close</button>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -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>
|
<button type="button" class="btn btn-primary" on:click={saveAndClose}>Close</button>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/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>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue