mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-22 22:39:36 +02:00
Share via modal
This commit is contained in:
parent
4d17484f86
commit
4ea7ef69a6
5 changed files with 150 additions and 9 deletions
|
@ -7,6 +7,9 @@
|
|||
|
||||
import Calendar from '~icons/mdi/calendar';
|
||||
|
||||
export let sharing: boolean = false;
|
||||
export let shared_with: string[] | undefined = undefined;
|
||||
|
||||
export let user: User;
|
||||
|
||||
async function nav() {
|
||||
|
@ -40,7 +43,13 @@
|
|||
</p>
|
||||
</div>
|
||||
<div class="card-actions justify-end">
|
||||
<button class="btn btn-primary" on:click={nav}>View</button>
|
||||
{#if !sharing}
|
||||
<button class="btn btn-primary" on:click={nav}>View</button>
|
||||
{:else if shared_with && !shared_with.includes(user.uuid)}
|
||||
<button class="btn btn-primary" on:click={() => dispatch('share', user)}>Share</button>
|
||||
{:else}
|
||||
<button class="btn btn-primary" on:click={() => dispatch('unshare', user)}>Unshare</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue