mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-27 20:17:05 +02:00
more patches
This commit is contained in:
@@ -47,23 +47,27 @@ const ReactionEvent = React.memo(({ event }: { event: NostrEvent }) => (
|
|||||||
));
|
));
|
||||||
|
|
||||||
const ZapEvent = React.memo(({ event }: { event: NostrEvent }) => {
|
const ZapEvent = React.memo(({ event }: { event: NostrEvent }) => {
|
||||||
const { payment, request } = parseZapNote(event);
|
try {
|
||||||
|
const { payment, request } = parseZapNote(event);
|
||||||
|
|
||||||
if (!payment.amount) return null;
|
if (!payment.amount) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex gap="2">
|
<Flex gap="2">
|
||||||
<Text>{readableAmountInSats(payment.amount)}</Text>
|
<Text>{readableAmountInSats(payment.amount)}</Text>
|
||||||
<Flex overflow="hidden" gap="2">
|
<Flex overflow="hidden" gap="2">
|
||||||
<UserAvatarLink pubkey={request.pubkey} size="xs" />
|
<UserAvatarLink pubkey={request.pubkey} size="xs" />
|
||||||
<UserLink pubkey={request.pubkey} />
|
<UserLink pubkey={request.pubkey} />
|
||||||
|
</Flex>
|
||||||
|
<Text>{request.content}</Text>
|
||||||
|
<Text ml="auto" flexShrink={0}>
|
||||||
|
{moment(convertTimestampToDate(event.created_at)).fromNow()}
|
||||||
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Text>{request.content}</Text>
|
);
|
||||||
<Text ml="auto" flexShrink={0}>
|
} catch (e) {
|
||||||
{moment(convertTimestampToDate(event.created_at)).fromNow()}
|
return <Text>Invalid Zap</Text>;
|
||||||
</Text>
|
}
|
||||||
</Flex>
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function sortEvents(a: NostrEvent, b: NostrEvent) {
|
function sortEvents(a: NostrEvent, b: NostrEvent) {
|
||||||
|
Reference in New Issue
Block a user