+
{/* Toolbar, with buttons for images and embeds */}
@@ -168,7 +165,14 @@ export function TextEditor(props: {
Embed an iframe
-
+ {/* Spacer that also focuses editor on click */}
+
+ editor?.chain().focus('end').createParagraphNear().run()
+ }
+ aria-hidden
+ />
{children}
@@ -258,14 +262,19 @@ const useUploadMutation = (editor: Editor | null) =>
}
)
-function RichContent(props: { content: JSONContent | string }) {
- const { content } = props
+function RichContent(props: {
+ content: JSONContent | string
+ smallImage?: boolean
+}) {
+ const { content, smallImage } = props
const editor = useEditor({
editorProps: { attributes: { class: proseClass } },
extensions: [
- // replace tiptap's Mention with ours, to add style and link
- ...exhibitExts.filter((ex) => ex.name !== Mention.name),
+ StarterKit,
+ smallImage ? DisplayImage : Image,
+ DisplayLink,
DisplayMention,
+ Iframe,
],
content,
editable: false,
@@ -276,13 +285,16 @@ function RichContent(props: { content: JSONContent | string }) {
}
// backwards compatibility: we used to store content as strings
-export function Content(props: { content: JSONContent | string }) {
+export function Content(props: {
+ content: JSONContent | string
+ smallImage?: boolean
+}) {
const { content } = props
return typeof content === 'string' ? (
) : (
-
+
)
}
diff --git a/web/components/feed/feed-comments.tsx b/web/components/feed/feed-comments.tsx
index 8c84039e..d4ba98b6 100644
--- a/web/components/feed/feed-comments.tsx
+++ b/web/components/feed/feed-comments.tsx
@@ -254,7 +254,7 @@ export function FeedComment(props: {
/>