Changed the bio in the comment box to bring up the modal

This commit is contained in:
James Morris 2022-07-26 18:08:18 +01:00
parent 7e4f0bf361
commit 843a79511f
2 changed files with 14 additions and 3 deletions

View File

@ -48,7 +48,7 @@ const Comment = (props) => {
const isPaidMember = member && !!member.paid;
const canReply = member && (isPaidMember || !paidOnly);
// comment.member.bio = 'Head of Marketing'; // FOR TESTING
comment.member.bio = 'Head of Marketing'; // FOR TESTING
if (isInEditMode) {
return (
@ -72,7 +72,7 @@ const Comment = (props) => {
<div className="flex items-baseline font-sans font-semibold text-[14px] tracking-tight text-neutral-400 dark:text-[rgba(255,255,255,0.5)]">
{comment.member.bio && <div>{comment.member.bio}<span className="mx-[0.3em]">·</span></div>}
<div>{formatRelativeTime(comment.created_at)}</div>
{comment.edited_at && <div><span className="mx-[0.3em]">·</span>Edited</div>}
<div><span className="mx-[0.3em]">·</span>Edited</div>
</div>
</div>}
</div>

View File

@ -236,6 +236,17 @@ const Form = (props) => {
editor.commands.focus();
};
const handleAddBio = (event) => {
event.preventDefault();
dispatchAction('openPopup', {
type: 'addDetailsDialog',
callback: () => {
editor.commands.focus();
}
});
};
let submitText;
if (props.isReply) {
submitText = <><span className="hidden sm:inline">Add </span><span className="capitalize sm:normal-case">reply</span></>;
@ -326,7 +337,7 @@ const Form = (props) => {
<div className="flex items-baseline font-sans font-semibold text-[14px] tracking-tight text-neutral-400 dark:text-[rgba(255,255,255,0.5)]">
{memberBio ?
<div>{memberBio}</div> :
<div>Add your bio</div>}
<button className="transition duration-150 hover:text-neutral-500" onClick={handleAddBio}>Add your bio</button>}
</div>
</Transition>
</div>