diff --git a/apps/comments-ui/src/actions.js b/apps/comments-ui/src/actions.js index b3b84e3761..a9ab9f77af 100644 --- a/apps/comments-ui/src/actions.js +++ b/apps/comments-ui/src/actions.js @@ -285,7 +285,7 @@ async function editComment({state, api, data: {comment, parent}}) { } async function updateMember({data, state, api}) { - const {name, bio} = data; + const {name, expertise} = data; const patchData = {}; const originalName = state?.member?.name; @@ -294,10 +294,10 @@ async function updateMember({data, state, api}) { patchData.name = name; } - const originalBio = state?.member?.bio; - if (bio !== undefined && originalBio !== bio) { + const originalExpertise = state?.member?.expertise; + if (expertise !== undefined && originalExpertise !== expertise) { // Allow to set it to an empty string or to null - patchData.bio = bio; + patchData.expertise = expertise; } if (Object.keys(patchData).length > 0) { diff --git a/apps/comments-ui/src/components/content/Comment.js b/apps/comments-ui/src/components/content/Comment.js index 616cc45a16..c527639361 100644 --- a/apps/comments-ui/src/components/content/Comment.js +++ b/apps/comments-ui/src/components/content/Comment.js @@ -116,16 +116,16 @@ function UnpublishedComment({comment, openEditMode}) { // Helper components -function MemberBio({comment}) { +function MemberExpertise({comment}) { const {member} = useContext(AppContext); - const memberBio = member && comment.member && comment.member.uuid === member.uuid ? member.bio : comment?.member?.bio; + const memberExpertise = member && comment.member && comment.member.uuid === member.uuid ? member.expertise : comment?.member?.expertise; - if (!memberBio) { + if (!memberExpertise) { return null; } return ( - {memberBio}· + {memberExpertise}· ); } @@ -193,7 +193,7 @@ function CommentHeader({comment}) {
- + {formatRelativeTime(comment.created_at)} @@ -214,7 +214,7 @@ function CommentBody({html}) { function CommentMenu({comment, toggleReplyMode, isInReplyMode, openEditMode, parent}) { // If this comment is from the current member, always override member - // with the member from the context, so we update the bio in existing comments when we change it + // with the member from the context, so we update the expertise in existing comments when we change it const {member, commentsEnabled} = useContext(AppContext); const paidOnly = commentsEnabled === 'paid'; diff --git a/apps/comments-ui/src/components/content/Form.js b/apps/comments-ui/src/components/content/Form.js index 61ec10056e..3c5edd034c 100644 --- a/apps/comments-ui/src/components/content/Form.js +++ b/apps/comments-ui/src/components/content/Form.js @@ -22,7 +22,7 @@ const Form = (props) => { const {comment, commentsCount} = props; const memberName = member?.name ?? comment?.member?.name; - const memberBio = member?.bio ?? comment?.member?.bio; + const memberExpertise = member?.expertise ?? comment?.member?.expertise; // Keep track of the amount of open forms useEffect(() => { @@ -393,7 +393,7 @@ const Form = (props) => { dispatchAction('openPopup', { type: 'addDetailsPopup', - bioAutofocus: options.bioAutofocus ?? false, + expertiseAutofocus: options.expertiseAutofocus ?? false, callback: () => { editor?.commands.focus(); setPreventClosing(false); @@ -467,17 +467,17 @@ const Form = (props) => { className="font-sans text-[17px] font-bold tracking-tight text-[rgb(23,23,23)] dark:text-[rgba(255,255,255,0.85)]" onClick={(event) => { handleShowPopup(event, { - bioAutofocus: false + expertiseAutofocus: false }); }}>{memberName ? memberName : 'Anonymous'}
diff --git a/apps/comments-ui/src/components/popups/AddDetailsPopup.js b/apps/comments-ui/src/components/popups/AddDetailsPopup.js index e6c969ed91..4fb077aadf 100644 --- a/apps/comments-ui/src/components/popups/AddDetailsPopup.js +++ b/apps/comments-ui/src/components/popups/AddDetailsPopup.js @@ -6,20 +6,20 @@ import {isMobile} from '../../utils/helpers'; const AddDetailsPopup = (props) => { const inputNameRef = useRef(null); - const inputBioRef = useRef(null); + const inputExpertiseRef = useRef(null); const {dispatchAction, member, accentColor} = useContext(AppContext); const [name, setName] = useState(member.name ?? ''); - const [bio, setBio] = useState(member.bio ?? ''); + const [expertise, setExpertise] = useState(member.expertise ?? ''); - const maxBioChars = 50; - let initialBioChars = maxBioChars; - if (member.bio) { - initialBioChars -= member.bio.length; + const maxExpertiseChars = 50; + let initialExpertiseChars = maxExpertiseChars; + if (member.expertise) { + initialExpertiseChars -= member.expertise.length; } - const [bioCharsLeft, setBioCharsLeft] = useState(initialBioChars); + const [expertiseCharsLeft, setExpertiseCharsLeft] = useState(initialExpertiseChars); - const [error, setError] = useState({name: '', bio: ''}); + const [error, setError] = useState({name: '', expertise: ''}); const stopPropagation = (event) => { event.stopPropagation(); @@ -34,7 +34,7 @@ const AddDetailsPopup = (props) => { if (name.trim() !== '') { await dispatchAction('updateMember', { name, - bio + expertise }); close(true); } else { @@ -48,8 +48,8 @@ const AddDetailsPopup = (props) => { useEffect(() => { if (!isMobile()) { const timer = setTimeout(() => { - if (props.bioAutofocus) { - inputBioRef.current?.focus(); + if (props.expertiseAutofocus) { + inputExpertiseRef.current?.focus(); } else { inputNameRef.current?.focus(); } @@ -59,7 +59,7 @@ const AddDetailsPopup = (props) => { clearTimeout(timer); }; } - }, [inputNameRef, inputBioRef, props.bioAutofocus]); + }, [inputNameRef, inputExpertiseRef, props.expertiseAutofocus]); const renderExampleProfiles = (index) => { const renderEl = (profile) => { @@ -155,28 +155,28 @@ const AddDetailsPopup = (props) => { />
-
{bioCharsLeft} characters left
+
{expertiseCharsLeft} characters left
{ - let bioText = e.target.value; - setBioCharsLeft(maxBioChars - bioText.length); - setBio(bioText); + let expertiseText = e.target.value; + setExpertiseCharsLeft(maxExpertiseChars - expertiseText.length); + setExpertise(expertiseText); }} onKeyDown={(e) => { if (e.key === 'Enter') { - setBio(e.target.value); + setExpertise(e.target.value); submit(); } }} - maxLength={maxBioChars} + maxLength={maxExpertiseChars} />