mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-17 21:31:43 +01:00
fix stream top zappers amount
This commit is contained in:
parent
a5fbfc274a
commit
30a3849ef3
@ -18,7 +18,7 @@ export default function GoalTopZappers({
|
||||
|
||||
const totals = zaps?.reduce<Record<string, number>>((dir, z) => {
|
||||
const sender = getZapSender(z);
|
||||
dir[sender] = dir[sender] + (getZapPayment(z)?.amount ?? 0);
|
||||
dir[sender] = (dir[sender] ?? 0) + (getZapPayment(z)?.amount ?? 0);
|
||||
return dir;
|
||||
}, {});
|
||||
|
||||
|
@ -9,13 +9,13 @@ import useStreamChatTimeline from "../stream/stream-chat/use-stream-chat-timelin
|
||||
import { ParsedStream } from "../../../helpers/nostr/stream";
|
||||
import UserAvatarLink from "../../../components/user/user-avatar-link";
|
||||
|
||||
export default function TopZappers({ stream, ...props }: FlexProps & { stream: ParsedStream }) {
|
||||
export default function StreamTopZappers({ stream, ...props }: FlexProps & { stream: ParsedStream }) {
|
||||
const { timeline } = useStreamChatTimeline(stream);
|
||||
const zaps = timeline.filter((e) => e.kind === kinds.Zap);
|
||||
|
||||
const totals = zaps?.reduce<Record<string, number>>((dir, z) => {
|
||||
const sender = getZapSender(z);
|
||||
dir[sender] = dir[sender] + (getZapPayment(z)?.amount ?? 0);
|
||||
dir[sender] = (dir[sender] ?? 0) + (getZapPayment(z)?.amount ?? 0);
|
||||
return dir;
|
||||
}, {});
|
||||
|
@ -35,7 +35,7 @@ import { UserEmojiProvider } from "../../../providers/global/emoji-provider";
|
||||
import StreamStatusBadge from "../components/status-badge";
|
||||
import ChatMessageForm from "./stream-chat/stream-chat-form";
|
||||
import StreamChatLog from "./stream-chat/chat-log";
|
||||
import TopZappers from "../components/top-zappers";
|
||||
import StreamTopZappers from "../components/stream-top-zappers";
|
||||
import StreamHashtags from "../components/stream-hashtags";
|
||||
import StreamZapButton from "../components/stream-zap-button";
|
||||
import StreamGoal from "../components/stream-goal";
|
||||
@ -185,7 +185,7 @@ function MobileStreamPage({ stream }: { stream: ParsedStream }) {
|
||||
Stream Chat
|
||||
</DrawerHeader>
|
||||
<DrawerBody p={0} overflow="hidden" display="flex" gap="2" flexDirection="column">
|
||||
<TopZappers stream={stream} px="2" />
|
||||
<StreamTopZappers stream={stream} px="2" />
|
||||
<StreamChatLog stream={stream} flex={1} px="2" />
|
||||
<ChatMessageForm stream={stream} />
|
||||
</DrawerBody>
|
||||
|
@ -5,7 +5,7 @@ import { ParsedStream } from "../../../../helpers/nostr/stream";
|
||||
import { LightboxProvider } from "../../../../components/lightbox-provider";
|
||||
import IntersectionObserverProvider from "../../../../providers/local/intersection-observer";
|
||||
import { useTimelineCurserIntersectionCallback } from "../../../../hooks/use-timeline-cursor-intersection-callback";
|
||||
import TopZappers from "../../components/top-zappers";
|
||||
import StreamTopZappers from "../../components/stream-top-zappers";
|
||||
import ChatMessageForm from "./stream-chat-form";
|
||||
import useStreamChatTimeline from "./use-stream-chat-timeline";
|
||||
import StreamChatLog from "./chat-log";
|
||||
@ -37,7 +37,7 @@ export default function StreamChat({
|
||||
</CardHeader>
|
||||
)}
|
||||
<CardBody display="flex" flexDirection="column" overflow="hidden" p={0}>
|
||||
<TopZappers stream={stream} py="2" px="4" pt={!isPopup ? 0 : undefined} />
|
||||
<StreamTopZappers stream={stream} py="2" px="4" pt={!isPopup ? 0 : undefined} />
|
||||
<StreamChatLog ref={scrollBox} stream={stream} flex={1} px="4" py="2" mb="2" />
|
||||
{!isChatLog && <ChatMessageForm stream={stream} />}
|
||||
</CardBody>
|
||||
|
Loading…
x
Reference in New Issue
Block a user