aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-actor-image
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-actor-image')
-rw-r--r--client/src/app/shared/shared-actor-image/actor-avatar.component.scss29
-rw-r--r--client/src/app/shared/shared-actor-image/actor-avatar.component.ts15
2 files changed, 14 insertions, 30 deletions
diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.scss b/client/src/app/shared/shared-actor-image/actor-avatar.component.scss
index a2424b593..68bf74553 100644
--- a/client/src/app/shared/shared-actor-image/actor-avatar.component.scss
+++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.scss
@@ -20,38 +20,23 @@
20 } 20 }
21} 21}
22 22
23.avatar-18 { 23$sizes: '18', '25', '28', '32', '34', '35', '36', '40', '48', '75', '80', '100', '120';
24 --avatarSize: 18px;
25 --initialFontSize: 13px;
26}
27 24
28.avatar-25 { 25@each $size in $sizes {
29 --avatarSize: 25px; 26 .avatar-#{$size} {
27 --avatarSize: #{$size}px;
28 }
30} 29}
31 30
32.avatar-32 { 31.avatar-18 {
33 --avatarSize: 32px; 32 --initialFontSize: 13px;
34}
35
36.avatar-34 {
37 --avatarSize: 34px;
38}
39
40.avatar-36 {
41 --avatarSize: 36px;
42}
43
44.avatar-40 {
45 --avatarSize: 40px;
46} 33}
47 34
48.avatar-100 { 35.avatar-100 {
49 --avatarSize: 100px;
50 --initialFontSize: 40px; 36 --initialFontSize: 40px;
51} 37}
52 38
53.avatar-120 { 39.avatar-120 {
54 --avatarSize: 120px;
55 --initialFontSize: 46px; 40 --initialFontSize: 46px;
56} 41}
57 42
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 c323dc724..bc7e8a096 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
@@ -4,11 +4,11 @@ import { Account } from '../shared-main/account/account.model'
4 4
5type ActorInput = { 5type ActorInput = {
6 name: string 6 name: string
7 avatar?: { url?: string, path: string } 7 avatars: { width: number, url?: string, path: string }[]
8 url: string 8 url: string
9} 9}
10 10
11export type ActorAvatarSize = '18' | '25' | '32' | '34' | '36' | '40' | '100' | '120' 11export type ActorAvatarSize = '18' | '25' | '28' | '32' | '34' | '35' | '36' | '40' | '48' | '75' | '80' | '100' | '120'
12 12
13@Component({ 13@Component({
14 selector: 'my-actor-avatar', 14 selector: 'my-actor-avatar',
@@ -23,7 +23,7 @@ export class ActorAvatarComponent {
23 23
24 @Input() previewImage: string 24 @Input() previewImage: string
25 25
26 @Input() size: ActorAvatarSize 26 @Input() size: ActorAvatarSize = '32'
27 27
28 // Use an external link 28 // Use an external link
29 @Input() href: string 29 @Input() href: string
@@ -50,14 +50,13 @@ export class ActorAvatarComponent {
50 } 50 }
51 51
52 get defaultAvatarUrl () { 52 get defaultAvatarUrl () {
53 if (this.channel) return VideoChannel.GET_DEFAULT_AVATAR_URL() 53 if (this.account) return Account.GET_DEFAULT_AVATAR_URL(+this.size)
54 54 if (this.channel) return VideoChannel.GET_DEFAULT_AVATAR_URL(+this.size)
55 return Account.GET_DEFAULT_AVATAR_URL()
56 } 55 }
57 56
58 get avatarUrl () { 57 get avatarUrl () {
59 if (this.account) return Account.GET_ACTOR_AVATAR_URL(this.account) 58 if (this.account) return Account.GET_ACTOR_AVATAR_URL(this.account, +this.size)
60 if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.channel) 59 if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.channel, +this.size)
61 60
62 return '' 61 return ''
63 } 62 }