From 875eeeb4e913db129c2ba3fc7d89e7097e8db1a6 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Mon, 15 Apr 2024 16:01:38 -0500 Subject: [PATCH] show channel close details --- src/components/Activity.tsx | 27 ++++++++++++++++++++------- src/components/GenericItem.tsx | 4 +++- src/routes/setup/AddFederation.tsx | 3 +-- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/components/Activity.tsx b/src/components/Activity.tsx index d0b9d313..ff625cd2 100644 --- a/src/components/Activity.tsx +++ b/src/components/Activity.tsx @@ -185,6 +185,25 @@ export function UnifiedActivityItem(props: { } }; + function handlePrimaryOnClick() { + if (primaryContact()?.id) { + navigate(`/chat/${primaryContact()?.id}`); + return; + } + + if (profileFromNostr()) { + props.onNewContactClick(profileFromNostr()!); + return; + } + + if ( + props.item.kind === "ChannelOpen" || + props.item.kind === "ChannelClose" + ) { + click(); + } + } + return (
: undefined} - primaryOnClick={() => - primaryContact()?.id - ? navigate(`/chat/${primaryContact()?.id}`) - : profileFromNostr() - ? props.onNewContactClick(profileFromNostr()!) - : undefined - } + primaryOnClick={handlePrimaryOnClick} amountOnClick={click} primaryName={ props.item.inbound diff --git a/src/components/GenericItem.tsx b/src/components/GenericItem.tsx index 45441d68..8f55c08d 100644 --- a/src/components/GenericItem.tsx +++ b/src/components/GenericItem.tsx @@ -43,7 +43,9 @@ export function GenericItem(props: { diff --git a/src/routes/setup/AddFederation.tsx b/src/routes/setup/AddFederation.tsx index 20867ae3..5841a4ae 100644 --- a/src/routes/setup/AddFederation.tsx +++ b/src/routes/setup/AddFederation.tsx @@ -6,8 +6,7 @@ import { ConfirmDialog, DefaultMain, ExternalLink, - MutinyWalletGuard, - VStack + MutinyWalletGuard } from "~/components"; import { useI18n } from "~/i18n/context";