From 677bf684e70f11be716fc3690b28e83d9963a2f6 Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Tue, 4 Jul 2023 12:55:38 -0500 Subject: [PATCH] show top zappers on stream --- src/components/note/note-zap-button.tsx | 38 +++++++++++++------ src/views/streams/stream/index.tsx | 14 ++++--- .../streams/stream/stream-chat/index.tsx | 19 +++++++++- .../stream/stream-chat/top-zappers.tsx | 35 +++++++++++++++++ 4 files changed, 86 insertions(+), 20 deletions(-) create mode 100644 src/views/streams/stream/stream-chat/top-zappers.tsx diff --git a/src/components/note/note-zap-button.tsx b/src/components/note/note-zap-button.tsx index 42b32e0bb..3f6691187 100644 --- a/src/components/note/note-zap-button.tsx +++ b/src/components/note/note-zap-button.tsx @@ -1,4 +1,4 @@ -import { Button, ButtonProps, useDisclosure } from "@chakra-ui/react"; +import { Button, ButtonProps, IconButton, useDisclosure } from "@chakra-ui/react"; import { readablizeSats } from "../../helpers/bolt11"; import { totalZaps } from "../../helpers/zaps"; import { useCurrentAccount } from "../../hooks/use-current-account"; @@ -31,19 +31,33 @@ export default function NoteZapButton({ eventZapsService.requestZaps(note.id, clientRelaysService.getReadUrls(), true); }; + const total = totalZaps(zaps); + return ( <> - + {total > 0 ? ( + + ) : ( + } + aria-label="Zap Note" + title="Zap Note" + {...props} + onClick={onOpen} + isDisabled={!metadata?.allowsNostr} + /> + )} + {isOpen && ( {isMobile && toggleButton} - + {!isMobile && ( + + )}