mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-02 08:58:36 +02:00
small stream chat features
This commit is contained in:
parent
677bf684e7
commit
e9685035b6
@ -1,4 +1,4 @@
|
||||
import { useRef } from "react";
|
||||
import React, { useRef } from "react";
|
||||
import { Box, Text } from "@chakra-ui/react";
|
||||
import { ParsedStream } from "../../../../helpers/nostr/stream";
|
||||
import { UserAvatar } from "../../../../components/user-avatar";
|
||||
@ -9,7 +9,7 @@ import { TrustProvider } from "../../../../providers/trust";
|
||||
import ChatMessageContent from "./chat-message-content";
|
||||
import NoteZapButton from "../../../../components/note/note-zap-button";
|
||||
|
||||
export default function ChatMessage({ event, stream }: { event: NostrEvent; stream: ParsedStream }) {
|
||||
function ChatMessage({ event, stream }: { event: NostrEvent; stream: ParsedStream }) {
|
||||
const ref = useRef<HTMLDivElement | null>(null);
|
||||
useRegisterIntersectionEntity(ref, event.id);
|
||||
|
||||
@ -29,3 +29,6 @@ export default function ChatMessage({ event, stream }: { event: NostrEvent; stre
|
||||
</TrustProvider>
|
||||
);
|
||||
}
|
||||
|
||||
const ChatMessageMemo = React.memo(ChatMessage);
|
||||
export default ChatMessageMemo;
|
||||
|
@ -19,15 +19,14 @@ export default function TopZappers({ zaps, ...props }: FlexProps & { zaps: Parse
|
||||
return (
|
||||
<Flex overflowX="auto" overflowY="hidden" gap="4" py="2" px="4" {...props}>
|
||||
{sortedTotals.map(([pubkey, total]) => (
|
||||
<Flex key={pubkey} gap="2" alignItems="center" maxW="sm">
|
||||
<Flex key={pubkey} gap="2" alignItems="center" maxW="2xs">
|
||||
<UserAvatar pubkey={pubkey} size="sm" noProxy />
|
||||
<Box>
|
||||
<UserLink pubkey={pubkey} isTruncated fontWeight="bold" />
|
||||
<Text whiteSpace="nowrap">
|
||||
<LightningIcon />
|
||||
{readablizeSats(total / 1000)}
|
||||
</Text>
|
||||
</Box>
|
||||
<Text whiteSpace="nowrap" isTruncated>
|
||||
<UserLink pubkey={pubkey} fontWeight="bold" />
|
||||
<br />
|
||||
<LightningIcon />
|
||||
{readablizeSats(total / 1000)}
|
||||
</Text>
|
||||
</Flex>
|
||||
))}
|
||||
</Flex>
|
||||
|
Loading…
x
Reference in New Issue
Block a user