From a7c9b8a0a3cbade84a2dd43dd34b0755bd301873 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Tue, 2 May 2023 17:12:02 -0500 Subject: [PATCH] wip activity route --- src/components/Activity.tsx | 10 ++-- src/routes/Activity.tsx | 109 ++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 5 deletions(-) create mode 100644 src/routes/Activity.tsx diff --git a/src/components/Activity.tsx b/src/components/Activity.tsx index 9171864..9026208 100644 --- a/src/components/Activity.tsx +++ b/src/components/Activity.tsx @@ -8,12 +8,12 @@ import { prettyPrintTime } from '~/utils/prettyPrintTime'; import { JsonModal } from '~/components/JsonModal'; import mempoolTxUrl from '~/utils/mempoolTxUrl'; -const THREE_COLUMNS = 'grid grid-cols-[auto,1fr,auto] gap-4 py-2 px-2 border-b border-neutral-800 last:border-b-0' -const CENTER_COLUMN = 'min-w-0 overflow-hidden max-w-full' -const MISSING_LABEL = 'py-1 px-2 bg-white/10 rounded inline-block text-sm' -const RIGHT_COLUMN = 'flex flex-col items-right text-right max-w-[8rem]' +export const THREE_COLUMNS = 'grid grid-cols-[auto,1fr,auto] gap-4 py-2 px-2 border-b border-neutral-800 last:border-b-0' +export const CENTER_COLUMN = 'min-w-0 overflow-hidden max-w-full' +export const MISSING_LABEL = 'py-1 px-2 bg-white/10 rounded inline-block text-sm' +export const RIGHT_COLUMN = 'flex flex-col items-right text-right max-w-[8rem]' -type OnChainTx = { +export type OnChainTx = { txid: string received: number sent: number diff --git a/src/routes/Activity.tsx b/src/routes/Activity.tsx new file mode 100644 index 0000000..9a7805c --- /dev/null +++ b/src/routes/Activity.tsx @@ -0,0 +1,109 @@ +import { For, ParentComponent, createMemo, createSignal } from "solid-js"; +import { CENTER_COLUMN, MISSING_LABEL, OnChainTx, RIGHT_COLUMN, THREE_COLUMNS } from "~/components/Activity"; +import { DeleteEverything } from "~/components/DeleteEverything"; +import { JsonModal } from "~/components/JsonModal"; +import KitchenSink from "~/components/KitchenSink"; +import NavBar from "~/components/NavBar"; +import { Card, DefaultMain, Hr, LargeHeader, NodeManagerGuard, SafeArea, SmallAmount, SmallHeader, VStack } from "~/components/layout"; +import { BackButton } from "~/components/layout/BackButton"; +import { StyledRadioGroup } from "~/components/layout/Radio"; +import mempoolTxUrl from "~/utils/mempoolTxUrl"; +import send from '~/assets/icons/send.svg'; +import receive from '~/assets/icons/receive.svg'; +import { prettyPrintTime } from "~/utils/prettyPrintTime"; + +const NAMES = ["alice", "bob", "carol", "dave", "ethan", "frank", "graham", "hancock"] + +function ContactRow() { + return ( +
+
+
+ + +
+
+ new +
+
+ + {(name) => ( +
+
+ {name[0]} +
+
+ {name} +
+
+ )} +
+
+ ) +} + +const CHOICES = [ + { value: "mutiny", label: "Mutiny", caption: "Your wallet activity" }, + { value: "nostr", label: "Zaps", caption: "Your friends on nostr" }, +] + +const SubtleText: ParentComponent = (props) => { + return

{props.children}

+} + +function OnChainItem(props: { item: OnChainTx }) { + const isReceive = createMemo(() => props.item.received > 0); + + const [open, setOpen] = createSignal(false) + + return ( + <> + + + Mempool Link + + +
setOpen(!open())}> +
+ {isReceive() ? receive arrow : send arrow} +
+
+

Unknown

+ {isReceive() ? : } + {/*

Txid: {props.item.txid}

*/} +
+
+ + {isReceive() ? "RECEIVE" : "SEND"} + + {props.item.confirmation_time?.Confirmed ? prettyPrintTime(props.item.confirmation_time?.Confirmed?.time) : "Unconfirmed"} +
+
+ + ) +} + +export default function Activity() { + const [choice, setChoice] = createSignal(CHOICES[0].value) + return ( + + + + + Activity + +
+ + + {/*

If you know what you're doing you're in the right place!

+ +
+ Danger zone + +
*/} +
+
+ +
+
+ ) +} \ No newline at end of file