diff options
| author | Adam Soltys <[email protected]> | 2023-03-10 16:24:05 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-03-10 16:24:05 -0800 |
| commit | f3195f7fc970e47065babdd5c454447b9d1e1429 (patch) | |
| tree | e52e1487d6ce95b0c9d1423f90f0ee4adaae8b4f /src/routes/(app) | |
| parent | 181dc9aa374b84db26aec970c14cdc140b3cd650 (diff) | |
| parent | 2488e7f762931f1daecc600f6d4fda3805614cb9 (diff) | |
| download | coinos-ui-f3195f7fc970e47065babdd5c454447b9d1e1429.tar.gz coinos-ui-f3195f7fc970e47065babdd5c454447b9d1e1429.zip | |
Merge branch 'master' into static-qr
Diffstat (limited to 'src/routes/(app)')
4 files changed, 14 insertions, 9 deletions
diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 45469bdb..0dcdc1b2 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -25,7 +25,6 @@ }; $: $selectedRate = r * (rates[u?.currency || 'USD'] / rates.USD); - $: $selectedRate = $rate * (rates[u?.currency || 'USD'] / rates.USD); onMount(() => { let localStorageLocale = localStorage.getItem(localeLocalStorageKey); diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index 133930b1..bbb2379e 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -59,6 +59,9 @@ t++; }, 10); }; + + let hideBio = true; + let toggleBio = () => (hideBio = false); </script> <div class="container mx-auto w-full px-4 mb-4 flex flex-wrap lg:flex-nowrap"> @@ -66,7 +69,11 @@ <div class="w-[240px] lg:absolute space-y-5 left-20 mx-auto lg:mr-10 mb-10"> <h1 class="text-3xl font-bold text-center mx-auto">{display || username}</h1> - <div class="text-secondary mx-auto text-center lg:text-left lg:mx-0"> + <div + class="text-secondary mx-auto text-center lg:text-left lg:mx-0" + class:line-clamp-3={hideBio} + on:click={toggleBio} + > {subject.address && subject.address !== 'null' ? subject.address : ''} </div> diff --git a/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js b/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js index 18eda839..c63328e2 100644 --- a/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js +++ b/src/routes/(app)/send/user/[username]/[...amount]/+page.server.js @@ -13,9 +13,6 @@ export const actions = { default: async ({ cookies, request }) => { try { let body = await fd(request); - let { amount } = body; - amount = parseInt(amount); - await post('/payments', body, auth(cookies)); } catch (e) { console.log(e); diff --git a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte index 74da1fa8..1bb88277 100644 --- a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte @@ -17,14 +17,16 @@ let a, af, fiat = !amount, - hash; + hash, + rate, + amountFiat = 0; - $: amountFiat = amount * ($selectedRate / sats); + selectedRate.subscribe((r) => rate || (amountFiat = amount * (r / sats))); let setAmount = async () => { amount = a; - amountFiat = af; - + amountFiat = parseFloat(af).toFixed(2); + rate = fiat ? (sats * amountFiat) / amount : $selectedRate; ({ hash } = await post(`/${subject.username}/invoice`, { invoice: { amount, |
