mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed avatar initials being broken in comment form (#21448)
REF PLG-248
This commit is contained in:
parent
cc8a36cc12
commit
456af29607
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
import {ReactComponent as AvatarIcon} from '../../images/icons/avatar.svg';
|
import {ReactComponent as AvatarIcon} from '../../images/icons/avatar.svg';
|
||||||
import {Comment, useAppContext} from '../../AppContext';
|
import {Comment, useAppContext} from '../../AppContext';
|
||||||
import {getMemberInitialsFromComment} from '../../utils/helpers';
|
import {getInitials, getMemberInitialsFromComment} from '../../utils/helpers';
|
||||||
|
|
||||||
function getDimensionClasses() {
|
function getDimensionClasses() {
|
||||||
return 'w-8 h-8';
|
return 'w-8 h-8';
|
||||||
|
@ -64,7 +64,8 @@ export const Avatar: React.FC<AvatarProps> = ({comment}) => {
|
||||||
return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;
|
return `hsl(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%)`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const memberInitials = (comment && getMemberInitialsFromComment(comment, t)) || '';
|
const memberInitials = (comment && getMemberInitialsFromComment(comment, t)) ||
|
||||||
|
(member && getInitials(member.name || '')) || '';
|
||||||
const commentMember = (comment ? comment.member : member);
|
const commentMember = (comment ? comment.member : member);
|
||||||
|
|
||||||
const bgColor = HSLtoString(generateHSL());
|
const bgColor = HSLtoString(generateHSL());
|
||||||
|
|
Loading…
Add table
Reference in a new issue