-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/TheTipo01/YADMB
- Loading branch information
Showing
8 changed files
with
133 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
</script> | ||
|
||
<slot /> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,66 @@ | ||
<script> | ||
import { Button } from "flowbite-svelte"; | ||
import { GetFavorites, AddFavorite, RemoveFavorite} from "../lib/favorites"; | ||
import {Modal} from "flowbite-svelte"; | ||
import {Input, Label} from "flowbite-svelte" | ||
import {Heading, P} from "flowbite-svelte" | ||
import TrashBinSolid from "flowbite-svelte-icons/TrashBinSolid.svelte" | ||
// props | ||
export let token; | ||
//variables | ||
let favorites = GetFavorites(token); | ||
let showModal = false; | ||
</script> | ||
|
||
<Button class="w-25 absolute right-9 bottom-5"> | ||
<Button class="w-25 absolute right-9 bottom-5 GenuineOrange" on:click={() => (showModal = true)}> | ||
Add to Favorites | ||
</Button> | ||
<div class="grid grid-col-2 gap-4"> | ||
|
||
<Modal title="Add Favorite" bind:open={showModal} autoclose> | ||
<form id="form"> | ||
<div class="grid grid-rows-3"> | ||
<div> | ||
<Label for="name" class="mb-2">Song Name</Label> | ||
<Input type="text" id="name" required/> | ||
</div> | ||
<div> | ||
<Label for="link" class="mb-2">Song Link</Label> | ||
<Input type="text" id="link" required/> | ||
</div> | ||
<div> | ||
<Label for="folder" class="mb-2">Folder</Label> | ||
<Input type="text" id="folder" /> | ||
</div> | ||
</div> | ||
</form> | ||
<svelte:fragment slot="footer"> | ||
<Button on:click={() => AddFavorite(token)}>Add</Button> | ||
</svelte:fragment> | ||
</Modal> | ||
|
||
</div> | ||
{#await favorites} | ||
<P>Loading Favorites</P> | ||
{:then favorite} | ||
{#if favorite.length != 0} | ||
<div class="grid grid-cols-3"> | ||
<Heading tag="h5">Song Name</Heading> | ||
<Heading tag="h5">Link</Heading> | ||
<Heading tag="h5">Folder</Heading> | ||
</div> | ||
{#each favorite as song} | ||
<div class="grid grid-cols-3 mt-5"> | ||
<P>{song.name}</P> | ||
<P>{song.link}</P> | ||
<div class="grid grid-cols-2"> | ||
<P>{song.folder}</P> | ||
<Button on:click={() => RemoveFavorite(token, song.name)}><TrashBinSolid /></Button> | ||
</div> | ||
|
||
</div> | ||
{/each} | ||
{:else} | ||
<P>You have no favorites</P> | ||
{/if} | ||
{/await} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters