fix: Disable previews in notification items

This commit is contained in:
Tom Moor
2023-08-23 22:34:21 -04:00
parent dfbd89ad53
commit 10ec8a59b4
2 changed files with 4 additions and 1 deletions

View File

@@ -48,6 +48,7 @@ export type Props = Optional<
> & { > & {
shareId?: string | undefined; shareId?: string | undefined;
embedsDisabled?: boolean; embedsDisabled?: boolean;
previewsDisabled?: boolean;
onHeadingsChange?: (headings: Heading[]) => void; onHeadingsChange?: (headings: Heading[]) => void;
onSynced?: () => Promise<void>; onSynced?: () => Promise<void>;
onPublish?: (event: React.MouseEvent) => any; onPublish?: (event: React.MouseEvent) => any;
@@ -62,6 +63,7 @@ function Editor(props: Props, ref: React.RefObject<SharedEditor> | null) {
onHeadingsChange, onHeadingsChange,
onCreateCommentMark, onCreateCommentMark,
onDeleteCommentMark, onDeleteCommentMark,
previewsDisabled,
} = props; } = props;
const userLocale = useUserLocale(); const userLocale = useUserLocale();
const locale = dateLocale(userLocale); const locale = dateLocale(userLocale);
@@ -339,7 +341,7 @@ function Editor(props: Props, ref: React.RefObject<SharedEditor> | null) {
userPreferences={preferences} userPreferences={preferences}
dictionary={dictionary} dictionary={dictionary}
{...props} {...props}
onHoverLink={handleLinkActive} onHoverLink={previewsDisabled ? undefined : handleLinkActive}
onClickLink={handleClickLink} onClickLink={handleClickLink}
onSearchLink={handleSearchLink} onSearchLink={handleSearchLink}
onChange={handleChange} onChange={handleChange}

View File

@@ -64,6 +64,7 @@ function NotificationListItem({ notification, onNavigate }: Props) {
{notification.comment && ( {notification.comment && (
<StyledCommentEditor <StyledCommentEditor
defaultValue={toJS(notification.comment.data)} defaultValue={toJS(notification.comment.data)}
previewsDisabled
/> />
)} )}
</Flex> </Flex>