aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-03-02 21:32:59 -0800
committerAdam Soltys <[email protected]>2026-03-02 21:32:59 -0800
commitf73a6be565bace826404d470b8e8a8c1a25eb19e (patch)
treeb47dde049fd6f0d70132500d9bd2be7837c0ccaa /src
parent7c4d393feaf9c594fa6bdae274abc0edd45c3373 (diff)
downloadcoinos-ui-f73a6be565bace826404d470b8e8a8c1a25eb19e.tar.gz
coinos-ui-f73a6be565bace826404d470b8e8a8c1a25eb19e.zip
fix svelte-check issues
Diffstat (limited to 'src')
-rw-r--r--src/components/AppHeader.svelte8
-rw-r--r--src/components/Menu.svelte9
-rw-r--r--src/routes/(app)/account/[id]/+page.svelte4
-rw-r--r--src/routes/(app)/messages/+layout.svelte10
-rw-r--r--src/routes/(app)/messages/+page.svelte7
-rw-r--r--src/routes/(app)/messages/[pubkey]/+page.svelte1
-rw-r--r--src/routes/(app)/pos/+page.svelte47
7 files changed, 27 insertions, 59 deletions
diff --git a/src/components/AppHeader.svelte b/src/components/AppHeader.svelte
index 27698a77..5f99cdc3 100644
--- a/src/components/AppHeader.svelte
+++ b/src/components/AppHeader.svelte
@@ -77,7 +77,7 @@
{#if user}
{#each links as { href, icon, label }}
<a {href} data-sveltekit-preload-code="eager" aria-label={label}>
- <button class="btn-menu {opacity(href)}" aria-label={label}>
+ <button class="flex justify-center items-center bg-base-100 p-2 rounded-full w-12 h-12 sm:w-16 sm:h-16 drop-shadow-xl {opacity(href)}" aria-label={label}>
<iconify-icon noobserver {icon} width={(w ?? 0) > 640 ? 32 : 24}></iconify-icon>
</button>
</a>
@@ -100,12 +100,6 @@
{/if}
<style>
- @reference "../app.css";
-
- .btn-menu {
- @apply flex justify-center items-center bg-base-100 p-2 rounded-full w-12 h-12 sm:w-16 sm:h-16 drop-shadow-xl;
- }
-
header {
z-index: 50;
view-transition-name: header;
diff --git a/src/components/Menu.svelte b/src/components/Menu.svelte
index 6c581ba1..6a7c488a 100644
--- a/src/components/Menu.svelte
+++ b/src/components/Menu.svelte
@@ -27,7 +27,7 @@
<div>
<OutClick onOutClick={hideMenu}>
- <button class="btn-menu {opacity('/support')}" onclick={toggleMenu} aria-label="Open menu">
+ <button class="flex justify-center items-center bg-base-100 p-2 rounded-full w-12 h-12 sm:w-16 sm:h-16 drop-shadow-xl {opacity('/support')}" onclick={toggleMenu} aria-label="Open menu">
<iconify-icon noobserver icon="ph:list-bold" width={w > 640 ? 32 : 24}></iconify-icon>
</button>
@@ -67,10 +67,3 @@
</OutClick>
</div>
-<style>
- @reference "../app.css";
-
- .btn-menu {
- @apply flex justify-center items-center bg-base-100 p-2 rounded-full w-12 h-12 sm:w-16 sm:h-16 drop-shadow-xl;
- }
-</style>
diff --git a/src/routes/(app)/account/[id]/+page.svelte b/src/routes/(app)/account/[id]/+page.svelte
index 6a83b153..3880d715 100644
--- a/src/routes/(app)/account/[id]/+page.svelte
+++ b/src/routes/(app)/account/[id]/+page.svelte
@@ -143,7 +143,7 @@
{:else}
<img src="/images/icon.png" class="w-8 h-8" alt="Coinos" />
{/if}
- {$t("accounts.accountTitle", { type: displayType })}
+ {$t("accounts.accountTitle", { type: displayType } as any)}
</h1>
<div class="container w-full mx-auto text-lg px-4 max-w-xl space-y-2">
@@ -169,7 +169,7 @@
{#if currencyChanged}
<div class="flex justify-between items-center">
- <span>{$t("accounts.updateCurrency", { currency })}</span>
+ <span>{$t("accounts.updateCurrency", { currency } as any)}</span>
<Toggle id="updateUserCurrency" bind:value={updateUserCurrency} />
</div>
{/if}
diff --git a/src/routes/(app)/messages/+layout.svelte b/src/routes/(app)/messages/+layout.svelte
index 230f8baf..2f7cd455 100644
--- a/src/routes/(app)/messages/+layout.svelte
+++ b/src/routes/(app)/messages/+layout.svelte
@@ -31,14 +31,14 @@
<div class="messages-layout">
<nav class="flex items-center p-4 gap-4 shrink-0">
{#if isDetail}
- <a href="/messages" class="btn-menu" aria-label="Back">
+ <a href="/messages" class="flex justify-center items-center bg-base-100 p-2 rounded-full w-12 h-12 sm:w-16 sm:h-16 drop-shadow-xl" aria-label="Back">
<iconify-icon noobserver icon="ph:arrow-left-bold" width={(w ?? 0) > 640 ? 32 : 24}></iconify-icon>
</a>
{/if}
<div class="ml-auto flex items-center gap-4">
<a href="/{user?.username}" data-sveltekit-preload-code="eager" aria-label="Home">
- <button class="btn-menu" aria-label="Home">
+ <button class="flex justify-center items-center bg-base-100 p-2 rounded-full w-12 h-12 sm:w-16 sm:h-16 drop-shadow-xl" aria-label="Home">
<iconify-icon noobserver icon="ph:house-bold" width={(w ?? 0) > 640 ? 32 : 24}></iconify-icon>
</button>
</a>
@@ -52,15 +52,9 @@
</div>
<style>
- @reference "../../../app.css";
-
.messages-layout {
display: flex;
flex-direction: column;
height: 100dvh;
}
-
- .btn-menu {
- @apply flex justify-center items-center bg-base-100 p-2 rounded-full w-12 h-12 sm:w-16 sm:h-16 drop-shadow-xl;
- }
</style>
diff --git a/src/routes/(app)/messages/+page.svelte b/src/routes/(app)/messages/+page.svelte
index 87198cb6..6c97c27c 100644
--- a/src/routes/(app)/messages/+page.svelte
+++ b/src/routes/(app)/messages/+page.svelte
@@ -86,12 +86,15 @@
};
// Restore from localStorage on hard refresh, or in-memory cache on SPA nav
- const storageKey = `chatList:${data.user?.pubkey}`;
- const cachedList = getCachedChatList(data.user?.pubkey);
+ // svelte-ignore state_referenced_locally
+ const userPubkey = data.user?.pubkey;
+ const storageKey = `chatList:${userPubkey}`;
+ const cachedList = getCachedChatList(userPubkey);
let stored: any = null;
try { stored = JSON.parse(localStorage.getItem(storageKey) || "null"); } catch {}
let chats: any[] = $state(cachedList?.chats ?? stored?.chats ?? []);
let allRumours: any[] = $state(cachedList?.rumours ?? stored?.rumours ?? []);
+ // svelte-ignore state_referenced_locally
let loaded = $state(chats.length > 0);
const updateSendersRecipients = async (rumours: any[]) => {
diff --git a/src/routes/(app)/messages/[pubkey]/+page.svelte b/src/routes/(app)/messages/[pubkey]/+page.svelte
index 52e032be..0828b057 100644
--- a/src/routes/(app)/messages/[pubkey]/+page.svelte
+++ b/src/routes/(app)/messages/[pubkey]/+page.svelte
@@ -69,6 +69,7 @@
return info.coinosUsername || info.nostrName || $t("dm.anonymous");
};
+ // svelte-ignore state_referenced_locally
let selectedChat: any = $state(libnip17.getCachedUserInfo(pubkey) ?? { pubkey });
let text = $state("");
let allRumours: any[] = $state([]);
diff --git a/src/routes/(app)/pos/+page.svelte b/src/routes/(app)/pos/+page.svelte
index a4662395..9f012010 100644
--- a/src/routes/(app)/pos/+page.svelte
+++ b/src/routes/(app)/pos/+page.svelte
@@ -150,7 +150,7 @@
{#if !connected}
<div class="text-center">
- <button class="btn" onclick={connect}>Connect</button>
+ <button class="px-4 py-2 rounded-2xl shadow" onclick={connect}>Connect</button>
<div class="text-sm mt-2 opacity-70">{portInfo}</div>
</div>
{/if}
@@ -158,10 +158,10 @@
{#if connected}
<!-- Tabs -->
<div class="flex gap-2 justify-center">
- <button class="btn" class:btn-neutral={tab === "config"} onclick={() => (tab = "config")}>
+ <button class="px-4 py-2 rounded-2xl shadow" class:bg-gray-200={tab === "config"} onclick={() => (tab = "config")}>
Flash config
</button>
- <button class="btn" class:btn-neutral={tab === "firmware"} onclick={() => (tab = "firmware")}>
+ <button class="px-4 py-2 rounded-2xl shadow" class:bg-gray-200={tab === "firmware"} onclick={() => (tab = "firmware")}>
Flash firmware
</button>
</div>
@@ -177,15 +177,15 @@
<b>{bytes.length} bytes</b>
)
</div>
- <label class="label mt-2" for="littlefs-address">LittleFS address (hex)</label>
+ <label class="text-sm opacity-70 mt-2" for="littlefs-address">LittleFS address (hex)</label>
<input
id="littlefs-address"
- class="input"
+ class="w-full px-3 py-2 border rounded-xl"
bind:value={littlefsAddress}
onchange={(e) => (littlefsAddress = Number((e.target as HTMLInputElement).value))}
/>
<div class="mt-3">
- <button class="btn" onclick={flashConfig}>Flash config</button>
+ <button class="px-4 py-2 rounded-2xl shadow" onclick={flashConfig}>Flash config</button>
</div>
{#if configProgress > 0}
<div class="mt-2">Progress: {configProgress}%</div>
@@ -193,28 +193,28 @@
{/if}
{:else}
<form method="POST" use:enhance class="space-y-2">
- <input name="ssid" placeholder="Wifi SSID" class="input" />
- <input name="key" placeholder="Wifi password" class="input" />
- <input name="token" bind:value={token} placeholder="Coinos API token" class="input" />
- <button type="submit" class="btn">Generate Config</button>
+ <input name="ssid" placeholder="Wifi SSID" class="w-full px-3 py-2 border rounded-xl" />
+ <input name="key" placeholder="Wifi password" class="w-full px-3 py-2 border rounded-xl" />
+ <input name="token" bind:value={token} placeholder="Coinos API token" class="w-full px-3 py-2 border rounded-xl" />
+ <button type="submit" class="px-4 py-2 rounded-2xl shadow">Generate Config</button>
</form>
{/if}
{:else}
<!-- NEW FIRMWARE FLOW -->
<div class="space-y-3">
- <label class="label" for="firmware-file">Select .ino.bin (firmware)</label>
+ <label class="text-sm opacity-70" for="firmware-file">Select .ino.bin (firmware)</label>
<input
id="firmware-file"
type="file"
accept=".bin,application/octet-stream"
- class="input"
+ class="w-full px-3 py-2 border rounded-xl"
onchange={onPickFw}
/>
- <label class="label" for="firmware-address">Firmware address (hex, default 0x10000)</label>
+ <label class="text-sm opacity-70" for="firmware-address">Firmware address (hex, default 0x10000)</label>
<input
id="firmware-address"
- class="input"
+ class="w-full px-3 py-2 border rounded-xl"
bind:value={fwAddress}
onchange={(e) => (fwAddress = Number((e.target as HTMLInputElement).value))}
/>
@@ -225,7 +225,7 @@
</label>
<div class="mt-3">
- <button class="btn" disabled={!fwBytes} onclick={flashFirmware}>Flash firmware</button>
+ <button class="px-4 py-2 rounded-2xl shadow" disabled={!fwBytes} onclick={flashFirmware}>Flash firmware</button>
</div>
{#if fwProgress > 0 && !fwDone}
@@ -241,20 +241,3 @@
{/if}
{/if}
</div>
-
-<style>
- @reference "../../../app.css";
-
- .btn {
- @apply px-4 py-2 rounded-2xl shadow;
- }
- .btn-neutral {
- @apply bg-gray-200;
- }
- .input {
- @apply w-full px-3 py-2 border rounded-xl;
- }
- .label {
- @apply text-sm opacity-70;
- }
-</style>