mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Added in additional check for avatar which will depend on where the data source comes from
refs: https://github.com/TryGhost/Team/issues/1531
This commit is contained in:
parent
5e3b3acad5
commit
1d25f6d494
2 changed files with 10 additions and 1 deletions
|
@ -2,5 +2,7 @@
|
|||
<div class="gh-member-initials flex items-center justify-center br-100 {{@containerClass}}" style={{this.backgroundStyle}}>
|
||||
<span class="gh-member-avatar-label {{or @sizeClass "gh-member-list-avatar"}}">{{this.initials}}</span>
|
||||
</div>
|
||||
<img class="gh-member-avatar-image" src="{{@member.avatarImage}}" alt="{{or @member.name @member.email}}" />
|
||||
{{#if this.avatarImage}}
|
||||
<img class="gh-member-avatar-image" src="{{this.avatarImage}}" alt="{{or @member.name @member.email}}" />
|
||||
{{/if}}
|
||||
</figure>
|
||||
|
|
|
@ -20,6 +20,13 @@ export default class GhMemberAvatarComponent extends Component {
|
|||
return get(member, 'name') || get(member, 'email') || 'NM';
|
||||
}
|
||||
|
||||
get avatarImage() {
|
||||
let {member} = this.args;
|
||||
|
||||
// to cover both ways avatar image is returned depending on where member data comes from
|
||||
return get(member, 'avatar_image') || get(member, 'avatarImage') || null;
|
||||
}
|
||||
|
||||
get backgroundStyle() {
|
||||
let color = stringToHslColor(this.memberName, 75, 55);
|
||||
return htmlSafe(`background-color: ${color}`);
|
||||
|
|
Loading…
Add table
Reference in a new issue