}
classes: string[] = []
- alt: string
defaultAvatarUrl: string
avatarUrl: string
ngOnInit () {
this.buildDefaultAvatarUrl()
- this.buildAlt()
this.buildAvatarUrl()
this.buildClasses()
}
ngOnChanges () {
- this.buildAlt()
this.buildAvatarUrl()
this.buildClasses()
}
}
}
- private buildAlt () {
- if (this.isAccount()) this.alt = $localize`Account avatar`
- else if (this.isChannel()) this.alt = $localize`Channel avatar`
- else this.alt = ''
- }
-
private buildDefaultAvatarUrl () {
this.defaultAvatarUrl = this.isChannel()
? VideoChannel.GET_DEFAULT_AVATAR_URL(this.getSizeNumber())
// Keep consistency with CSS
const themes = {
'0123456789abc': 'blue',
- def: 'green',
- ghi: 'purple',
- jkl: 'gray',
- mno: 'yellow',
- pqr: 'orange',
- stvu: 'red',
- wxyz: 'dark-blue'
+ 'def': 'green',
+ 'ghi': 'purple',
+ 'jkl': 'gray',
+ 'mno': 'yellow',
+ 'pqr': 'orange',
+ 'stvu': 'red',
+ 'wxyz': 'dark-blue'
}
const theme = Object.keys(themes)