show channel close details

This commit is contained in:
Paul Miller
2024-04-15 16:01:38 -05:00
committed by benthecarman
parent 15926619c7
commit 875eeeb4e9
3 changed files with 24 additions and 10 deletions

View File

@@ -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 ( return (
<div class="pt-3 first-of-type:pt-0"> <div class="pt-3 first-of-type:pt-0">
<Suspense <Suspense
@@ -218,13 +237,7 @@ export function UnifiedActivityItem(props: {
: profileFromNostr()?.primal_image_url || "" : profileFromNostr()?.primal_image_url || ""
} }
icon={shouldShowShuffle() ? <Shuffle /> : undefined} icon={shouldShowShuffle() ? <Shuffle /> : undefined}
primaryOnClick={() => primaryOnClick={handlePrimaryOnClick}
primaryContact()?.id
? navigate(`/chat/${primaryContact()?.id}`)
: profileFromNostr()
? props.onNewContactClick(profileFromNostr()!)
: undefined
}
amountOnClick={click} amountOnClick={click}
primaryName={ primaryName={
props.item.inbound props.item.inbound

View File

@@ -43,7 +43,9 @@ export function GenericItem(props: {
<Match when={props.icon}> <Match when={props.icon}>
<button <button
class="flex h-[3rem] w-[3rem] items-center justify-center" class="flex h-[3rem] w-[3rem] items-center justify-center"
onClick={() => props.primaryOnClick} onClick={() =>
props.primaryOnClick && props.primaryOnClick()
}
> >
{props.icon} {props.icon}
</button> </button>

View File

@@ -6,8 +6,7 @@ import {
ConfirmDialog, ConfirmDialog,
DefaultMain, DefaultMain,
ExternalLink, ExternalLink,
MutinyWalletGuard, MutinyWalletGuard
VStack
} from "~/components"; } from "~/components";
import { useI18n } from "~/i18n/context"; import { useI18n } from "~/i18n/context";