aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-26 20:54:49 -0800
committerAdam Soltys <[email protected]>2024-11-26 20:54:49 -0800
commit872aa0b3b0b9a847b8afcdee7f1ad53c524ce4f0 (patch)
tree4d505c5b7c3f137b56c84cfaca12ed486aa4972c /src/components
parentf9300236a3c0227e0eec58326fa322e58613bc2d (diff)
downloadcoinos-ui-872aa0b3b0b9a847b8afcdee7f1ad53c524ce4f0.tar.gz
coinos-ui-872aa0b3b0b9a847b8afcdee7f1ad53c524ce4f0.zip
warnings
Diffstat (limited to 'src/components')
-rw-r--r--src/components/About.svelte22
-rw-r--r--src/components/Footer.svelte2
-rw-r--r--src/components/LandingHeader.svelte12
-rw-r--r--src/components/Lnurlp.svelte16
-rw-r--r--src/components/Lnurlw.svelte7
-rw-r--r--src/components/LocaleSelector.svelte10
-rw-r--r--src/components/LocationsMap.svelte3
-rw-r--r--src/components/PasswordInput.svelte20
-rw-r--r--src/components/Pinpad.svelte18
9 files changed, 56 insertions, 54 deletions
diff --git a/src/components/About.svelte b/src/components/About.svelte
index 5f87e99a..1f02e20d 100644
--- a/src/components/About.svelte
+++ b/src/components/About.svelte
@@ -2,7 +2,6 @@
import { onMount } from "svelte";
import Icon from "$comp/Icon.svelte";
import Image from "$comp/Image.svelte";
- import LocationsMap from "$comp/LocationsMap.svelte";
import { t } from "$lib/translations";
let team = [
@@ -90,18 +89,17 @@
>
{@html $t("about.locations.description")}
</p>
- <!-- <LocationsMap {locations} /> -->
- <a href="/map">
- <div class="relative">
- <img src="/map.png" class="mx-auto" />
+ <div class="relative">
+ <a href="/map" class="contents">
+ <img src="/map.png" class="mx-auto" alt="Map" />
+ </a>
- <button
- class="bg-black text-white border border-4 rounded-full px-6 py-2 font-bold hover:bg-secondary absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 text-2xl"
- >
- {$t("about.locations.viewMap")}
- </button>
- </div>
- </a>
+ <button
+ class="bg-black text-white border border-4 rounded-full px-6 py-2 font-bold hover:bg-secondary absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 text-2xl"
+ >
+ {$t("about.locations.viewMap")}
+ </button>
+ </div>
</div>
{/if}
diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte
index 3af5f6a3..dad8aeab 100644
--- a/src/components/Footer.svelte
+++ b/src/components/Footer.svelte
@@ -23,7 +23,7 @@
>
<div class="space-y-5">
<div class="text-center w-full">
- <a href="/">
+ <a href="/" aria-label="Home">
<iconify-icon icon="coinos:logo" width="224"></iconify-icon>
</a>
</div>
diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte
index c20c80a0..f2c94ade 100644
--- a/src/components/LandingHeader.svelte
+++ b/src/components/LandingHeader.svelte
@@ -7,12 +7,7 @@
import DarkToggle from "$comp/DarkToggle.svelte";
import LocaleSelector from "$comp/LocaleSelector.svelte";
- let {
- howItWorks,
- faq,
- about,
- user
- } = $props();
+ let { howItWorks, faq, about, user } = $props();
let showMobileMenu = $state(false);
let header = $state();
@@ -28,7 +23,7 @@
>
<nav class="block lg:flex justify-between items-center">
<div class="flex justify-start lg:justify-center items-center lg:space-x-5">
- <a href="/" onclick={() => scroll(header)}>
+ <a href="/" onclick={() => scroll(header)} aria-label="Home">
<iconify-icon icon="coinos:logo" width="224"></iconify-icon>
</a>
</div>
@@ -74,13 +69,14 @@
</div>
<button
+ aria-label="Menu"
class="block lg:hidden absolute top-[34.5px] right-10 z"
onclick={() => (showMobileMenu = !showMobileMenu)}
>
<iconify-icon
icon={!showMobileMenu ? "ph:list-bold" : "ph:x-bold"}
width="32"
-></iconify-icon>
+ ></iconify-icon>
</button>
<div
diff --git a/src/components/Lnurlp.svelte b/src/components/Lnurlp.svelte
index 74be0571..6f9a2b26 100644
--- a/src/components/Lnurlp.svelte
+++ b/src/components/Lnurlp.svelte
@@ -1,5 +1,5 @@
<script>
- import { run } from 'svelte/legacy';
+ import { run } from "svelte/legacy";
import { t } from "$lib/translations";
import { enhance } from "$app/forms";
@@ -7,20 +7,12 @@
import Spinner from "$comp/Spinner.svelte";
import { pin } from "$lib/store";
- let {
- data,
- form,
- send = $bindable(),
- comment = $bindable()
- } = $props();
+ let { data, form, send = $bindable(), comment = $bindable() } = $props();
let { currency } = data.user;
let { minSendable, maxSendable, commentAllowed, callback, metadata, rates } =
data;
- let rate;
- run(() => {
- rate = rates[currency];
- });
+ let rate = $derived(rates[currency]);
let amount = $state(Math.round(minSendable / 1000)),
loading = $state();
@@ -63,7 +55,7 @@
class="w-full p-4 border rounded-xl h-32 text-xl"
bind:value={comment}
autocapitalize="none"
-></textarea>
+ ></textarea>
{/if}
<div class="flex w-full">
diff --git a/src/components/Lnurlw.svelte b/src/components/Lnurlw.svelte
index 50aa1488..a9b6695a 100644
--- a/src/components/Lnurlw.svelte
+++ b/src/components/Lnurlw.svelte
@@ -1,6 +1,4 @@
<script>
- import { run } from 'svelte/legacy';
-
import { sats, f, s } from "$lib/utils";
import { t } from "$lib/translations";
import { enhance } from "$app/forms";
@@ -19,10 +17,7 @@
callback,
rates,
} = data;
- let rate;
- run(() => {
- rate = rates[currency];
- });
+ let rate = $derived(rates[currency]);
let amount = $state(Math.round(minWithdrawable / 1000)),
loading = $state();
diff --git a/src/components/LocaleSelector.svelte b/src/components/LocaleSelector.svelte
index cb057dbd..e5d1fdec 100644
--- a/src/components/LocaleSelector.svelte
+++ b/src/components/LocaleSelector.svelte
@@ -1,18 +1,16 @@
<script>
- import { run } from 'svelte/legacy';
+ import { run } from "svelte/legacy";
import { t, locale, locales } from "$lib/translations";
let { style } = $props();
-
- let l;
- run(() => {
- l = $locale;
- });
+ let l = $state($locale);
const handleChange = ({ currentTarget }) => {
const { value } = currentTarget;
document.cookie = `lang=${value}; path=/`;
+ console.log("settinglocale", value);
$locale = value;
+ l = value;
};
</script>
diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte
index 36223b75..c47dbf49 100644
--- a/src/components/LocationsMap.svelte
+++ b/src/components/LocationsMap.svelte
@@ -263,6 +263,7 @@
></div>
<div class="absolute flex top-2 left-2 gap-2">
<button
+ aria-label="Back"
class="rounded-full border-2 border-black bg-base-100 w-16 h-16 flex items-center justify-center bg-opacity-80"
onclick={back}
>
@@ -278,7 +279,7 @@
<input bind:value={search} class="w-full" />
<div class="flex gap-1 absolute right-6 top-3">
{#if search}
- <button onclick={clearSearch}>
+ <button type="button" onclick={clearSearch} aria-label="Clear">
<iconify-icon icon="ph:x-bold" width="32"></iconify-icon>
</button>
{:else}
diff --git a/src/components/PasswordInput.svelte b/src/components/PasswordInput.svelte
new file mode 100644
index 00000000..5885304b
--- /dev/null
+++ b/src/components/PasswordInput.svelte
@@ -0,0 +1,20 @@
+<script>
+ let { value = $bindable() } = $props();
+ let toggle = (e) => (show = !show);
+ let show = $state(false);
+ let icon = $derived(show ? "ph:eye-bold" : "ph:eye-slash-bold");
+</script>
+
+<label
+ for="password"
+ class="input flex items-center justify-center gap-2 w-full"
+>
+ {#if show}
+ <input name="password" type="text" bind:value class="clean" />
+ {:else}
+ <input name="password" type="password" bind:value class="clean" />
+ {/if}
+ <button type="button" aria-label="Toggle" onclick={toggle} class="contents">
+ <iconify-icon {icon} width="32"></iconify-icon>
+ </button>
+</label>
diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte
index 8f0fc3c2..0efdd471 100644
--- a/src/components/Pinpad.svelte
+++ b/src/components/Pinpad.svelte
@@ -1,6 +1,4 @@
<script>
- import { preventDefault, stopPropagation } from "svelte/legacy";
-
import Left from "$comp/Left.svelte";
import Icon from "$comp/Icon.svelte";
import { focus, post, warning } from "$lib/utils";
@@ -38,6 +36,12 @@
};
let hide = $state(true);
+
+ let toggle = (e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ hide = !hide;
+ };
</script>
<label
@@ -62,12 +66,10 @@
pattern="[0-9]+"
/>
{/if}
- <iconify-icon
- icon={hide ? "ph:eye-slash-bold" : "ph:eye-bold"}
- width="32"
- onclick={stopPropagation(preventDefault(() => (hide = !hide)))}
- class="cursor-pointer"
- ></iconify-icon>
+ <button type="button" class="contents" onclick={toggle}>
+ <iconify-icon icon={hide ? "ph:eye-slash-bold" : "ph:eye-bold"} width="32"
+ ></iconify-icon></button
+ >
</label>
<div class="grid grid-cols-3 gap-2 w-[300px] mx-auto grayscale">