diff options
| author | Adam Soltys <[email protected]> | 2024-11-07 16:43:31 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-07 16:43:31 -0800 |
| commit | 1f4f3f55238b9fdb6885e42cda386ef6130555be (patch) | |
| tree | 6ed599d366ff0389d2e394d4ca8aefa58e0e6432 | |
| parent | 030f3e76bec7bf4379fc48ca0a10c11efc90cd36 (diff) | |
| download | coinos-ui-1f4f3f55238b9fdb6885e42cda386ef6130555be.tar.gz coinos-ui-1f4f3f55238b9fdb6885e42cda386ef6130555be.zip | |
svelte 5 fixes
| -rw-r--r-- | src/components/Account.svelte | 13 | ||||
| -rw-r--r-- | src/components/Items.svelte | 21 | ||||
| -rw-r--r-- | src/routes/(app)/messages/+page.svelte | 8 | ||||
| -rw-r--r-- | src/routes/(static)/register/+page.svelte | 6 |
4 files changed, 24 insertions, 24 deletions
diff --git a/src/components/Account.svelte b/src/components/Account.svelte index b3bba3b1..310e5a70 100644 --- a/src/components/Account.svelte +++ b/src/components/Account.svelte @@ -11,13 +11,16 @@ let refresh = (a) => ({ seed, balance, id } = a); let setAccount = () => (document.cookie = `aid=${id}; path=/; max-age=86400`); + let go = (url) => { + setAccount(); + goto(url); + }; </script> -<a - href={`/payments`} - class="block space-y-2 border-primary py-4" +<div + class="block space-y-2 border-primary py-4 cursor-pointer" class:border-b-8={!last} - on:click={setAccount} + on:click={() => go("/payments")} > <div class="flex"> <Balance {balance} {user} {rate} /> @@ -48,4 +51,4 @@ </button> </a> </div> -</a> +</div> diff --git a/src/components/Items.svelte b/src/components/Items.svelte index 2916721d..db5dedc1 100644 --- a/src/components/Items.svelte +++ b/src/components/Items.svelte @@ -135,23 +135,20 @@ {/if} {#if user?.username === subject.username} <div class="flex gap-2 justify-center absolute top-2 right-2"> - <button type="button" on:click|stopPropagation={() => {}}> - <a href={`/items/${i.id}`}> - <button - class="bg-black rounded-full w-12 h-12 bg-opacity-40 hover:bg-opacity-100" - > - <Icon icon="edit" style="w-8 mx-auto invert" /> - </button> - </a> - </button> + <a href={`/items/${i.id}`}> + <button + class="bg-black rounded-full w-12 h-12 bg-opacity-40 hover:bg-opacity-100" + > + <Icon icon="edit" style="w-8 mx-auto invert" /> + </button> + </a> <button class="bg-black rounded-full w-12 h-12 bg-opacity-40 hover:bg-opacity-100" on:click|stopPropagation={() => del(i)} > <Icon icon="trash" style="w-8 mx-auto invert" /> </button> - <button - type="button" + <div on:click|stopPropagation={() => {}} class="sm:hidden" on:mousedown={startDrag} @@ -165,7 +162,7 @@ <Icon icon="move" style="w-8 mx-auto invert" /> </button> </a> - </button> + </div> </div> {/if} </div> diff --git a/src/routes/(app)/messages/+page.svelte b/src/routes/(app)/messages/+page.svelte index 547a1f21..61464770 100644 --- a/src/routes/(app)/messages/+page.svelte +++ b/src/routes/(app)/messages/+page.svelte @@ -70,14 +70,14 @@ {#if latest.length && user?.id === subject.id} <div class="relative"> {#each latest as { content, pubkey, author, recipient }} - {@const user = author.id === user.id ? recipient : author} - <a href={`/messages/${user.username}`}> + {@const u = author.id === user.id ? recipient : author} + <a href={`/messages/${u.username}`}> <div class="flex hover:bg-gray-100 p-4 rounded-2xl"> <div class="my-auto"> - <Avatar {user} size={"20"} disabled={true} /> + <Avatar user={u} size={"20"} disabled={true} /> </div> <div class="my-auto truncate"> - <div class="my-auto ml-1 text-lg font-bold">{user.username}</div> + <div class="my-auto ml-1 text-lg font-bold">{u.username}</div> <div class="my-auto ml-1 text-secondary text-lg truncate"> {content} </div> diff --git a/src/routes/(static)/register/+page.svelte b/src/routes/(static)/register/+page.svelte index ae838237..fe9a4aa2 100644 --- a/src/routes/(static)/register/+page.svelte +++ b/src/routes/(static)/register/+page.svelte @@ -88,7 +88,7 @@ let data = new FormData(this); let user = Object.fromEntries(data); - console.log("USER", JSON.stringify(user)) + console.log("USER", JSON.stringify(user)); await generate(user); for (let k in user) { @@ -173,7 +173,7 @@ > <iconify-icon icon="ph:caret-left-bold" width="32" /> </button> - <button class="block relative w-32 mx-auto" on:click={selectAvatar}> + <div class="block relative w-32 mx-auto" on:click={selectAvatar}> <button class="w-32 h-32 rounded-full border-4 border-white overflow-hidden flex mx-auto relative" > @@ -188,7 +188,7 @@ > <iconify-icon icon="ph:upload-simple-bold" width="24" /> </button> - </button> + </div> <button class="absolute w-8 h-12 right-12 bg-base-100 rounded top-12" on:click={incr} |
