aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/payments
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-24 00:41:51 -0800
committerAdam Soltys <[email protected]>2024-12-24 00:41:51 -0800
commit23f0335aeb26b56d835a7134227e43f8798fc3c5 (patch)
treed477237d739237e2ca527750be2cd139393fb36a /src/routes/(app)/payments
parentde913914cc77500c5176cb0aaa2def0acfe98b37 (diff)
downloadcoinos-ui-23f0335aeb26b56d835a7134227e43f8798fc3c5.tar.gz
coinos-ui-23f0335aeb26b56d835a7134227e43f8798fc3c5.zip
create fund
Diffstat (limited to 'src/routes/(app)/payments')
-rw-r--r--src/routes/(app)/payments/[...page]/+page.svelte110
1 files changed, 7 insertions, 103 deletions
diff --git a/src/routes/(app)/payments/[...page]/+page.svelte b/src/routes/(app)/payments/[...page]/+page.svelte
index d53c13c0..09bdf4c7 100644
--- a/src/routes/(app)/payments/[...page]/+page.svelte
+++ b/src/routes/(app)/payments/[...page]/+page.svelte
@@ -1,6 +1,6 @@
<script>
- import { run } from "svelte/legacy";
import Avatar from "$comp/Avatar.svelte";
+ import Payments from "$comp/Payments.svelte";
import { onMount } from "svelte";
import { format } from "date-fns";
import { newPayment } from "$lib/store";
@@ -193,113 +193,17 @@
</div>
</a>
{:else if isEllipsis(i)}
- <div class="join-item btn !w-auto !btn-sm btn-disabled !bg-base-200">...</div>
+ <div
+ class="join-item btn !w-auto !btn-sm btn-disabled !bg-base-200"
+ >
+ ...
+ </div>
{/if}
{/each}
{/if}
</div>
- <div class="text-base">
- {#each payments as p, i}
- <div
- class="grid grid-cols-12 border-b border-base-200 hover:bg-base-200 px-1 py-2 lg:p-4 cursor-pointer"
- class:border-b-0={i === payments.length - 1}
- class:text-error={p.amount < 0}
- onclick={() => goto(`/payment/${p.id}`)}
- >
- <div class="whitespace-nowrap my-auto col-span-3">
- <div class="font-bold flex items-center">
- <div class="flex items-center">
- <iconify-icon
- icon="ph:lightning-fill"
- width="24"
- class="text-yellow-300"
- ></iconify-icon>
- <div>{s(Math.abs(p.amount), userLocale)}</div>
- </div>
- </div>
-
- <div class="text-secondary flex items-center text-base">
- {f(Math.abs(p.amount) * (p.rate / sats), p.currency, userLocale)}
-
- {#if p.tip}
- <span class="text-sm text-secondary">
- &nbsp;+{Math.round((p.tip / Math.abs(p.amount)) * 100)}%
- </span>
- {/if}
- </div>
- </div>
-
- <div
- class="flex my-auto col-span-6 truncate text-ellipsis overflow-hidden mx-auto"
- >
- {#if p.type === types.pot}
- <a href={`/pot/${p.memo}`}>
- <div class="text-secondary flex">
- <div class="my-auto mr-1">
- <img src="/images/moneypot.png" class="w-12" alt="Pot" />
- </div>
-
- <div class="my-auto">Pot</div>
- </div>
- </a>
- {:else if p.with}
- <div class="flex">
- <div class="my-auto">
- <Avatar user={p.with} size={12} disabled={true} />
- </div>
- <div class="my-auto ml-1 text-secondary">
- {p.with.username}
- </div>
- </div>
- {:else}
- <div class="text-secondary flex items-center gap-1">
- {#if p.type === types.lightning}
- <iconify-icon
- icon="ph:lightning-fill"
- class="text-yellow-300 text-3xl"
- ></iconify-icon>
- {:else if p.type === types.ecash}
- <img src="/images/cash.png" class="w-12" />
- {:else if p.type === types.reconcile}
- <iconify-icon icon="ph:scales-bold" width="32"></iconify-icon>
- {:else if p.type === types.bitcoin}
- <iconify-icon icon="logos:bitcoin" class="text-3xl"
- ></iconify-icon>
- {:else if p.type === types.liquid}
- <div class="my-auto">
- <img
- src="/images/liquid.svg"
- class="w-10 border-4 border-transparent"
- alt="Liquid"
- />
- </div>
- {/if}
-
- <div class="my-auto">
- {p.amount > 0
- ? p.confirmed
- ? "Received"
- : "Pending"
- : "Sent"}
- </div>
- </div>
- {/if}
- </div>
-
- <div class="text-secondary text-right text-sm my-auto col-span-3">
- <div>
- {format(new Date(p.created), "h:mm aaa", { locale })}
- </div>
- <div>
- {format(new Date(p.created), "MMM d, yy", { locale })}
- </div>
- </div>
- </div>
- {:else}
- <p class="text-secondary text-lg text-center">{$t("payments.empty")}</p>
- {/each}
- </div>
+ <Payments {payments} />
<div class="grid grid-cols-3 w-full text-center text-lg">
{#each Object.keys(incoming) as c}