url: string
}
+export type ActorAvatarSize = '18' | '25' | '32' | '34' | '36' | '40' | '100' | '120'
+
@Component({
selector: 'my-actor-avatar',
styleUrls: [ './actor-avatar.component.scss' ],
@Input() previewImage: SafeResourceUrl
- @Input() size: '18' | '25' | '32' | '34' | '36' | '40' | '100' | '120'
+ @Input() size: ActorAvatarSize
// Use an external link
@Input() href: string
return ''
}
- get class () {
+ getClass (type: 'avatar' | 'initial') {
const base = [ 'avatar' ]
if (this.size) base.push(`avatar-${this.size}`)
- if (this.account) base.push('account')
- else base.push('channel')
+ if (this.channel) base.push('channel')
+ else base.push('account')
- if (this.initial) {
+ if (type === 'initial' && this.initial) {
base.push('initial')
base.push(this.getColorTheme())
}
}
get defaultAvatarUrl () {
- if (this.account) Account.GET_DEFAULT_AVATAR_URL()
if (this.channel) return VideoChannel.GET_DEFAULT_AVATAR_URL()
- return ''
+ return Account.GET_DEFAULT_AVATAR_URL()
}
get avatarUrl () {
if (this.account) return Account.GET_ACTOR_AVATAR_URL(this.account)
- if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.account)
+ if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.channel)
return ''
}
jkl: 'gray',
mno: 'yellow',
pqr: 'orange',
- stv: 'red',
+ stvu: 'red',
wxyz: 'dark-blue'
}