Skip to content

Commit

Permalink
show channel close details
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul authored and benthecarman committed Apr 15, 2024
1 parent 1592661 commit 875eeeb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
27 changes: 20 additions & 7 deletions src/components/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/components/GenericItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 1 addition & 2 deletions src/routes/setup/AddFederation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import {
ConfirmDialog,
DefaultMain,
ExternalLink,
MutinyWalletGuard,
VStack
MutinyWalletGuard
} from "~/components";
import { useI18n } from "~/i18n/context";

Expand Down

0 comments on commit 875eeeb

Please sign in to comment.