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

View File

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

View File

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