mirror of https://github.com/Chocobozzz/PeerTube
Fix actor avatar background
parent
931d343018
commit
8b5c8cd1e5
|
@ -1,7 +1,7 @@
|
|||
<ng-template #img>
|
||||
<img *ngIf="previewImage || avatarUrl || !initial" [class]="class" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" />
|
||||
<img *ngIf="previewImage || avatarUrl || !initial" [class]="getClass('avatar')" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" />
|
||||
|
||||
<div *ngIf="!avatarUrl && initial" [class]="class">
|
||||
<div *ngIf="!avatarUrl && initial" [class]="getClass('initial')">
|
||||
<span>{{ initial }}</span>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
|
|
@ -48,7 +48,7 @@ export class ActorAvatarComponent {
|
|||
return ''
|
||||
}
|
||||
|
||||
get class () {
|
||||
getClass (type: 'avatar' | 'initial') {
|
||||
const base = [ 'avatar' ]
|
||||
|
||||
if (this.size) base.push(`avatar-${this.size}`)
|
||||
|
@ -56,7 +56,7 @@ export class ActorAvatarComponent {
|
|||
if (this.account) base.push('account')
|
||||
else base.push('channel')
|
||||
|
||||
if (this.initial) {
|
||||
if (type === 'initial' && this.initial) {
|
||||
base.push('initial')
|
||||
base.push(this.getColorTheme())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue