diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-15 14:59:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-16 11:37:08 +0200 |
commit | 5b0ec7cddb1ae6dbd2057f067382866f846b882c (patch) | |
tree | 5751d96ec4ab0d49b793c4ff1c8edbc8daeab6ac /client/src/app/shared/shared-actor-image | |
parent | b13a0a48bacb53e65e665774e621326452045294 (diff) | |
download | PeerTube-5b0ec7cddb1ae6dbd2057f067382866f846b882c.tar.gz PeerTube-5b0ec7cddb1ae6dbd2057f067382866f846b882c.tar.zst PeerTube-5b0ec7cddb1ae6dbd2057f067382866f846b882c.zip |
Increase global font size
Diffstat (limited to 'client/src/app/shared/shared-actor-image')
-rw-r--r-- | client/src/app/shared/shared-actor-image/actor-avatar.component.html | 4 | ||||
-rw-r--r-- | client/src/app/shared/shared-actor-image/actor-avatar.component.ts | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.html b/client/src/app/shared/shared-actor-image/actor-avatar.component.html index c285b6cc3..ba025da4d 100644 --- a/client/src/app/shared/shared-actor-image/actor-avatar.component.html +++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.html | |||
@@ -1,7 +1,7 @@ | |||
1 | <ng-template #img> | 1 | <ng-template #img> |
2 | <img *ngIf="previewImage || avatarUrl || !initial" [class]="getClass('avatar')" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" /> | 2 | <img *ngIf="previewImage || avatarUrl || !initial" [class]="classes" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" /> |
3 | 3 | ||
4 | <div *ngIf="!avatarUrl && initial" [ngClass]="getClass('initial')"> | 4 | <div *ngIf="!avatarUrl && initial" [ngClass]="classes"> |
5 | <span>{{ initial }}</span> | 5 | <span>{{ initial }}</span> |
6 | </div> | 6 | </div> |
7 | </ng-template> | 7 | </ng-template> |
diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts index 600984aa2..fa4f1e51f 100644 --- a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts +++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component, Input } from '@angular/core' | 1 | import { Component, Input, OnChanges } from '@angular/core' |
2 | import { VideoChannel } from '../shared-main' | 2 | import { VideoChannel } from '../shared-main' |
3 | import { Account } from '../shared-main/account/account.model' | 3 | import { Account } from '../shared-main/account/account.model' |
4 | 4 | ||
@@ -15,7 +15,7 @@ export type ActorAvatarSize = '18' | '25' | '28' | '32' | '34' | '35' | '36' | ' | |||
15 | styleUrls: [ './actor-avatar.component.scss' ], | 15 | styleUrls: [ './actor-avatar.component.scss' ], |
16 | templateUrl: './actor-avatar.component.html' | 16 | templateUrl: './actor-avatar.component.html' |
17 | }) | 17 | }) |
18 | export class ActorAvatarComponent { | 18 | export class ActorAvatarComponent implements OnChanges { |
19 | private _title: string | 19 | private _title: string |
20 | 20 | ||
21 | @Input() account: ActorInput | 21 | @Input() account: ActorInput |
@@ -42,6 +42,8 @@ export class ActorAvatarComponent { | |||
42 | return '' | 42 | return '' |
43 | } | 43 | } |
44 | 44 | ||
45 | classes: string[] = [] | ||
46 | |||
45 | get alt () { | 47 | get alt () { |
46 | if (this.account) return $localize`Account avatar` | 48 | if (this.account) return $localize`Account avatar` |
47 | if (this.channel) return $localize`Channel avatar` | 49 | if (this.channel) return $localize`Channel avatar` |
@@ -68,20 +70,18 @@ export class ActorAvatarComponent { | |||
68 | return name.slice(0, 1) | 70 | return name.slice(0, 1) |
69 | } | 71 | } |
70 | 72 | ||
71 | getClass (type: 'avatar' | 'initial') { | 73 | ngOnChanges () { |
72 | const base = [ 'avatar' ] | 74 | this.classes = [ 'avatar' ] |
73 | 75 | ||
74 | if (this.size) base.push(`avatar-${this.size}`) | 76 | if (this.size) this.classes.push(`avatar-${this.size}`) |
75 | 77 | ||
76 | if (this.channel) base.push('channel') | 78 | if (this.channel) this.classes.push('channel') |
77 | else base.push('account') | 79 | else this.classes.push('account') |
78 | 80 | ||
79 | if (type === 'initial' && this.initial) { | 81 | if (!this.avatarUrl && this.initial) { |
80 | base.push('initial') | 82 | this.classes.push('initial') |
81 | base.push(this.getColorTheme()) | 83 | this.classes.push(this.getColorTheme()) |
82 | } | 84 | } |
83 | |||
84 | return base | ||
85 | } | 85 | } |
86 | 86 | ||
87 | hasActor () { | 87 | hasActor () { |