Commented out Bio stuff for now until it can be wired up

- Please note the commenting out of code here
- We want to put this back in when Bio is available

refs: https://github.com/TryGhost/Team/issues/1716
This commit is contained in:
James Morris 2022-07-27 11:39:11 +01:00
parent 8b4b838547
commit 9bd258b461
2 changed files with 27 additions and 17 deletions

View File

@ -5,6 +5,7 @@ import Avatar from './Avatar';
import {useEditor, EditorContent} from '@tiptap/react';
import {getEditorConfig} from '../utils/editor';
import {isMobile} from '../utils/helpers';
import {formatRelativeTime} from '../utils/helpers';
const Form = (props) => {
const {member, postId, dispatchAction, onAction, avatarSaturation} = useContext(AppContext);
@ -13,7 +14,7 @@ const Form = (props) => {
const {comment, commentsCount} = props;
const memberName = (props.isEdit ? comment.member.name : member.name);
const memberBio = false; // FOR TESTING
// const memberBio = false; // TODO: needed for bio to be wired up
let config;
if (props.isReply) {
@ -236,16 +237,17 @@ const Form = (props) => {
editor.commands.focus();
};
const handleAddBio = (event) => {
event.preventDefault();
// TODO: needed for bio to be wired up
// const handleAddBio = (event) => {
// event.preventDefault();
dispatchAction('openPopup', {
type: 'addDetailsDialog',
callback: () => {
editor.commands.focus();
}
});
};
// dispatchAction('openPopup', {
// type: 'addDetailsDialog',
// callback: () => {
// editor.commands.focus();
// }
// });
// };
let submitText;
if (props.isReply) {
@ -334,9 +336,12 @@ const Form = (props) => {
>
<h4 className="text-[17px] font-sans font-bold tracking-tight dark:text-[rgba(255,255,255,0.85)]">{memberName ? memberName : 'Anonymous'}</h4>
<div className="flex items-baseline font-sans font-semibold text-[14px] tracking-tight text-neutral-400 dark:text-[rgba(255,255,255,0.5)]">
{/* TODO: bio text field ready for wiring up
{memberBio ?
<div>{memberBio}</div> :
<button className="transition duration-150 hover:text-neutral-500" onClick={handleAddBio}>Add your bio</button>}
<button className="transition duration-150 hover:text-neutral-500" onClick={handleAddBio}>Add your bio</button>
} */}
<div>{props.isEdit ? formatRelativeTime(comment.created_at) : 'Now'}</div>
</div>
</Transition>
</div>

View File

@ -5,8 +5,11 @@ import AppContext from '../../AppContext';
const AddNameDialog = (props) => {
const inputNameRef = useRef(null);
const inputBioRef = useRef(null);
// const inputBioRef = useRef(null); // TODO: needed for bio to be wired up
const {dispatchAction} = useContext(AppContext);
const [name, setName] = useState('');
// const [bio, setBio] = useState(''); // TODO: needed for bio to be wired up
const [error, setError] = useState({name: '', bio: ''});
const close = () => {
dispatchAction('closePopup');
@ -19,6 +22,9 @@ const AddNameDialog = (props) => {
});
// TODO: need to save the bio, too
// await dispatchAction('updateMemberBio', {
// bio
// });
props.callback();
close();
@ -40,9 +46,6 @@ const AddNameDialog = (props) => {
};
}, [inputNameRef]);
const [name, setName] = useState('');
const [bio, setBio] = useState('');
const [error, setError] = useState({name: '', bio: ''});
return (
<>
<h1 className="font-sans font-bold tracking-tight text-[24px] mb-3 text-black">Add context to your comments</h1>
@ -81,6 +84,8 @@ const AddNameDialog = (props) => {
}}
maxLength="64"
/>
{/* TODO: bio text field ready for wiring up
<div className="flex flex-row mt-4 mb-2 justify-between">
<label htmlFor="comments-name" className="font-sans font-medium text-sm">Bio</label>
<Transition
@ -113,9 +118,9 @@ const AddNameDialog = (props) => {
}
}}
maxLength="50"
/>
/> */}
<button
className="transition-opacity duration-200 ease-linear w-full h-[44px] mt-10 px-8 flex items-center justify-center rounded-md text-white font-sans font-semibold text-[15px] bg-[#3204F5] opacity-100 hover:opacity-90"
className="transition-opacity duration-200 ease-linear w-full h-[44px] mt-8 px-8 flex items-center justify-center rounded-md text-white font-sans font-semibold text-[15px] bg-[#3204F5] opacity-100 hover:opacity-90"
onClick={submit}
>
Save