mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-10-04 16:37:00 +02:00
small timeline improvements
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React from "react";
|
||||
import React, { memo } from "react";
|
||||
import { ErrorBoundary as ErrorBoundaryHelper, FallbackProps } from "react-error-boundary";
|
||||
import { Alert, AlertIcon, AlertTitle, AlertDescription } from "@chakra-ui/react";
|
||||
|
||||
@@ -12,8 +12,8 @@ export function ErrorFallback({ error, resetErrorBoundary }: Partial<FallbackPro
|
||||
);
|
||||
}
|
||||
|
||||
export const ErrorBoundary = ({ children, ...props }: { children: React.ReactNode }) => (
|
||||
export const ErrorBoundary = memo(({ children, ...props }: { children: React.ReactNode }) => (
|
||||
<ErrorBoundaryHelper FallbackComponent={ErrorFallback} {...props}>
|
||||
{children}
|
||||
</ErrorBoundaryHelper>
|
||||
);
|
||||
));
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import React, { useRef } from "react";
|
||||
import { useRef, memo } from "react";
|
||||
import {
|
||||
Box,
|
||||
ButtonGroup,
|
||||
@@ -111,8 +111,7 @@ export type NoteProps = Omit<CardProps, "children"> & {
|
||||
registerIntersectionEntity?: boolean;
|
||||
clickable?: boolean;
|
||||
};
|
||||
export const Note = React.memo(
|
||||
({
|
||||
export function Note({
|
||||
event,
|
||||
variant = "outline",
|
||||
showReplyButton,
|
||||
@@ -121,7 +120,7 @@ export const Note = React.memo(
|
||||
registerIntersectionEntity = true,
|
||||
clickable = true,
|
||||
...props
|
||||
}: NoteProps) => {
|
||||
}: NoteProps) {
|
||||
const account = useCurrentAccount();
|
||||
const { showReactions, showSignatureVerification } = useSubject(appSettings);
|
||||
const replyForm = useDisclosure();
|
||||
@@ -210,7 +209,6 @@ export const Note = React.memo(
|
||||
{detailsModal.isOpen && <EventInteractionDetailsModal isOpen onClose={detailsModal.onClose} event={event} />}
|
||||
</TrustProvider>
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export default Note;
|
||||
export default memo(Note);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { useRef } from "react";
|
||||
import { memo, useRef } from "react";
|
||||
import { Flex, Heading, Link, Text } from "@chakra-ui/react";
|
||||
import { kinds, nip18 } from "nostr-tools";
|
||||
import { Link as RouterLink } from "react-router-dom";
|
||||
@@ -18,7 +18,7 @@ import { parseHardcodedNoteContent } from "../../../helpers/nostr/events";
|
||||
import { getEventCommunityPointer } from "../../../helpers/nostr/communities";
|
||||
import LoadingNostrLink from "../../loading-nostr-link";
|
||||
|
||||
export default function RepostEvent({ event }: { event: NostrEvent }) {
|
||||
function RepostEvent({ event }: { event: NostrEvent }) {
|
||||
const muteFilter = useUserMuteFilter();
|
||||
const hardCodedNote = parseHardcodedNoteContent(event);
|
||||
|
||||
@@ -68,3 +68,5 @@ export default function RepostEvent({ event }: { event: NostrEvent }) {
|
||||
</TrustProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default memo(RepostEvent);
|
||||
|
@@ -27,8 +27,6 @@ function TimelineItem({ event, visible, minHeight }: { event: NostrEvent; visibl
|
||||
content = isReply(event) ? <ReplyNote event={event} /> : <Note event={event} showReplyButton />;
|
||||
break;
|
||||
case kinds.Repost:
|
||||
content = <RepostEvent event={event} />;
|
||||
break;
|
||||
case kinds.GenericRepost:
|
||||
content = <RepostEvent event={event} />;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user