diff --git a/web/src/components/PartProfile/PartProfile.js b/web/src/components/PartProfile/PartProfile.js index 8bc1187..4d879b6 100644 --- a/web/src/components/PartProfile/PartProfile.js +++ b/web/src/components/PartProfile/PartProfile.js @@ -1,4 +1,4 @@ -import { useState, useEffect } from 'react' +import { useState, useEffect, useRef } from 'react' import { useAuth } from '@redwoodjs/auth' import { Link, navigate, routes } from '@redwoodjs/router' import Editor from 'rich-markdown-editor' @@ -23,6 +23,7 @@ const PartProfile = ({ const [isConfirmDialogOpen, setIsConfirmDialogOpen] = useState(false) const [isInvalid, setIsInvalid] = useState(false) const { currentUser } = useAuth() + const editorRef = useRef(null) const canEdit = currentUser?.sub === userPart.id const isImageEditable = !isEditable && canEdit // image is editable when not in profile edit mode in order to separate them as it's too hard too to upload an image to cloudinary temporarily until the use saves (and maybe have to clean up) for the time being const part = userPart?.Part @@ -165,11 +166,16 @@ const PartProfile = ({ width={1010} /> )} +
+ {isEditable ? 'Markdown supported' : ''} +
editorRef?.current?.focusAtEnd()} >