From 0a9e76f600524f0df771811683edd88ccd53274e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 18 Mar 2025 21:08:49 -0400 Subject: [PATCH] fix: Mentions of current user not highlighted (#8718) --- app/components/CollectionDescription.tsx | 3 +++ app/editor/index.tsx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/CollectionDescription.tsx b/app/components/CollectionDescription.tsx index 2b76f4dd84..be2ba2fb4f 100644 --- a/app/components/CollectionDescription.tsx +++ b/app/components/CollectionDescription.tsx @@ -11,6 +11,7 @@ import Collection from "~/models/Collection"; import Editor from "~/components/Editor"; import LoadingIndicator from "~/components/LoadingIndicator"; import { withUIExtensions } from "~/editor/extensions"; +import useCurrentUser from "~/hooks/useCurrentUser"; import usePolicy from "~/hooks/usePolicy"; import useStores from "~/hooks/useStores"; import Text from "./Text"; @@ -24,6 +25,7 @@ type Props = { function CollectionDescription({ collection }: Props) { const { collections } = useStores(); const { t } = useTranslation(); + const user = useCurrentUser({ rejectOnEmpty: true }); const can = usePolicy(collection); const handleSave = React.useMemo( @@ -65,6 +67,7 @@ function CollectionDescription({ collection }: Props) { maxLength={CollectionValidation.maxDescriptionLength} canUpdate={can.update} readOnly={!can.update} + userId={user.id} editorStyle={editorStyle} embedsDisabled /> diff --git a/app/editor/index.tsx b/app/editor/index.tsx index 0e8fe99a4c..328730bea1 100644 --- a/app/editor/index.tsx +++ b/app/editor/index.tsx @@ -843,7 +843,7 @@ const EditorContainer = styled(Styles)<{ ${(props) => props.userId && css` - .mention[data-id=${props.userId}] { + .mention[data-id="${props.userId}"] { color: ${props.theme.textHighlightForeground}; background: ${props.theme.textHighlight};