aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-account-avatar/account-avatar.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-account-avatar/account-avatar.component.ts')
-rw-r--r--client/src/app/shared/shared-account-avatar/account-avatar.component.ts25
1 files changed, 13 insertions, 12 deletions
diff --git a/client/src/app/shared/shared-account-avatar/account-avatar.component.ts b/client/src/app/shared/shared-account-avatar/account-avatar.component.ts
index d5533d459..02a0a18bf 100644
--- a/client/src/app/shared/shared-account-avatar/account-avatar.component.ts
+++ b/client/src/app/shared/shared-account-avatar/account-avatar.component.ts
@@ -1,5 +1,4 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { Account as AccountInterface } from '@shared/models'
3import { Account } from '../shared-main/account/account.model' 2import { Account } from '../shared-main/account/account.model'
4 3
5@Component({ 4@Component({
@@ -8,21 +7,23 @@ import { Account } from '../shared-main/account/account.model'
8 templateUrl: './account-avatar.component.html' 7 templateUrl: './account-avatar.component.html'
9}) 8})
10export class AccountAvatarComponent { 9export class AccountAvatarComponent {
11 _href: string 10 @Input() account: {
12 _title: string 11 name: string
13 12 avatar?: { url?: string, path: string }
14 @Input() account: { name: string, avatar?: { url?: string }, url: string } 13 url: string
15 @Input() size = '36'
16 @Input() set href (value) {
17 this._href = value
18 } 14 }
15 @Input() size: '25' | '34' | '36' | '40' | '120' = '36'
16
17 // Use an external link
18 @Input() href: string
19 // Use routerLink
20 @Input() internalHref: string | string[]
21
19 @Input() set title (value) { 22 @Input() set title (value) {
20 this._title = value 23 this._title = value
21 } 24 }
22 25
23 get href () { 26 private _title: string
24 return this._href || this.account?.url
25 }
26 27
27 get title () { 28 get title () {
28 return this._title || $localize`${this.account.name} (account page)` 29 return this._title || $localize`${this.account.name} (account page)`
@@ -33,6 +34,6 @@ export class AccountAvatarComponent {
33 } 34 }
34 35
35 get avatarUrl () { 36 get avatarUrl () {
36 return this.account?.avatar ? this.account.avatar.url : Account.GET_DEFAULT_AVATAR_URL() 37 return Account.GET_ACTOR_AVATAR_URL(this.account)
37 } 38 }
38} 39}