0
Fork 0
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:
Sanne de Vries 2024-10-29 11:44:00 +01:00 committed by GitHub
parent cc8a36cc12
commit 456af29607
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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());