fix: Disable previews in notification items
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user