X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Faccount%2Factor-avatar-info.component.ts;h=de78a390e1ead62e81e92d2d742e5ff4a8a26cd5;hb=123f61933611f326ea5a5e8c2ea253ee8720e4f0;hp=0c04ae4a64e71c4f7430387aa3fa78271dc19633;hpb=67ed6552b831df66713bac9e672738796128d33f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts b/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts index 0c04ae4a6..de78a390e 100644 --- a/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts +++ b/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts @@ -1,9 +1,9 @@ -import { BytesPipe } from 'ngx-pipes' import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' import { Notifier, ServerService } from '@app/core' -import { Account, VideoChannel } from '@app/shared/shared-main' -import { I18n } from '@ngx-translate/i18n-polyfill' +import { getBytes } from '@root-helpers/bytes' import { ServerConfig } from '@shared/models' +import { VideoChannel } from '../video-channel/video-channel.model' +import { Account } from '../account/account.model' @Component({ selector: 'my-actor-avatar-info', @@ -17,19 +17,12 @@ export class ActorAvatarInfoComponent implements OnInit { @Output() avatarChange = new EventEmitter() - maxSizeText: string - private serverConfig: ServerConfig - private bytesPipe: BytesPipe constructor ( private serverService: ServerService, - private notifier: Notifier, - private i18n: I18n - ) { - this.bytesPipe = new BytesPipe() - this.maxSizeText = this.i18n('max size') - } + private notifier: Notifier + ) { } ngOnInit (): void { this.serverConfig = this.serverService.getTmpConfig() @@ -55,10 +48,14 @@ export class ActorAvatarInfoComponent implements OnInit { } get maxAvatarSizeInBytes () { - return this.bytesPipe.transform(this.maxAvatarSize) + return getBytes(this.maxAvatarSize) } get avatarExtensions () { return this.serverConfig.avatar.file.extensions.join(', ') } + + get avatarFormat () { + return `${$localize`max size`}: 192*192px, ${this.maxAvatarSizeInBytes} ${$localize`extensions`}: ${this.avatarExtensions}` + } }