mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added in a hover state for editng bio
- Improved the affordance for editing bio - Added a new edit icon for this refs https://github.com/TryGhost/Team/issues/1756
This commit is contained in:
parent
2b2b7c540b
commit
ac3dd62e6e
2 changed files with 8 additions and 4 deletions
|
@ -7,6 +7,7 @@ import {getEditorConfig} from '../utils/editor';
|
||||||
import {isMobile} from '../utils/helpers';
|
import {isMobile} from '../utils/helpers';
|
||||||
// import {formatRelativeTime} from '../utils/helpers';
|
// import {formatRelativeTime} from '../utils/helpers';
|
||||||
import {ReactComponent as SpinnerIcon} from '../images/icons/spinner.svg';
|
import {ReactComponent as SpinnerIcon} from '../images/icons/spinner.svg';
|
||||||
|
import {ReactComponent as EditIcon} from '../images/icons/edit.svg';
|
||||||
|
|
||||||
const Form = (props) => {
|
const Form = (props) => {
|
||||||
const {member, postId, dispatchAction, avatarSaturation} = useContext(AppContext);
|
const {member, postId, dispatchAction, avatarSaturation} = useContext(AppContext);
|
||||||
|
@ -408,21 +409,23 @@ const Form = (props) => {
|
||||||
leaveFrom="opacity-100"
|
leaveFrom="opacity-100"
|
||||||
leaveTo="opacity-0"
|
leaveTo="opacity-0"
|
||||||
>
|
>
|
||||||
<button
|
<div
|
||||||
className="text-[17px] font-sans font-bold tracking-tight text-[rgb(23,23,23)] dark:text-[rgba(255,255,255,0.85)]"
|
className="text-[17px] font-sans font-bold tracking-tight text-[rgb(23,23,23)] dark:text-[rgba(255,255,255,0.85)]"
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
handleShowDialog(event, {
|
handleShowDialog(event, {
|
||||||
bioAutofocus: false
|
bioAutofocus: false
|
||||||
});
|
});
|
||||||
}}>{memberName ? memberName : 'Anonymous'}</button>
|
}}>{memberName ? memberName : 'Anonymous'}</div>
|
||||||
<div className="flex items-baseline">
|
<div className="flex items-baseline">
|
||||||
<button
|
<button
|
||||||
className={`transition duration-150 font-sans text-[14px] tracking-tight text-neutral-400 hover:text-neutral-500 dark:text-[rgba(255,255,255,0.5)] ${!memberBio && 'text-neutral-300 hover:text-neutral-400'}`}
|
className={`group transition duration-150 flex justify-start items-center font-sans text-[14px] tracking-tight text-neutral-400 hover:text-neutral-500 dark:text-[rgba(255,255,255,0.5)] ${!memberBio && 'text-neutral-300 hover:text-neutral-400'}`}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
handleShowDialog(event, {
|
handleShowDialog(event, {
|
||||||
bioAutofocus: true
|
bioAutofocus: true
|
||||||
});
|
});
|
||||||
}}>{memberBio ? memberBio : 'Add your bio'}</button>
|
}}>{memberBio ? memberBio : 'Add your bio'}
|
||||||
|
{memberBio && <EditIcon className="transition-all duration-100 ease-out opacity-0 -translate-x-[6px] group-hover:opacity-100 group-hover:translate-x-0 w-[12px] h-[12px] stroke-neutral-500 ml-1" />}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
|
|
1
apps/comments-ui/src/images/icons/edit.svg
Normal file
1
apps/comments-ui/src/images/icons/edit.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><g stroke-linecap="round" stroke-width="2" fill="none" stroke-linejoin="round" class="nc-icon-wrapper"><polygon points="7 21 2 22 3 17 18 2 22 6 7 21"></polygon></g></svg>
|
After Width: | Height: | Size: 254 B |
Loading…
Add table
Reference in a new issue