X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bmy-account%2Fmy-account.component.ts;h=450454ca2659940d83d7b24da3e71e604da32a2b;hb=05ac4ac7ed5107ac8ef1d0d1f9fd5009bf29bedc;hp=a8f5f8f31d55b28ab71b72a3beabb2de833ece4c;hpb=5d08a6a74e83f2e4dfe2f3ba7f5a39371e1bc89e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+my-account/my-account.component.ts b/client/src/app/+my-account/my-account.component.ts index a8f5f8f31..450454ca2 100644 --- a/client/src/app/+my-account/my-account.component.ts +++ b/client/src/app/+my-account/my-account.component.ts @@ -1,17 +1,67 @@ -import { Component } from '@angular/core' -import { ServerService } from '@app/core' +import { Component, OnInit } from '@angular/core' +import { AuthUser, ScreenService } from '@app/core' +import { TopMenuDropdownParam } from '../shared/shared-main/misc/top-menu-dropdown.component' @Component({ selector: 'my-my-account', - templateUrl: './my-account.component.html' + templateUrl: './my-account.component.html', + styleUrls: [ './my-account.component.scss' ] }) -export class MyAccountComponent { +export class MyAccountComponent implements OnInit { + menuEntries: TopMenuDropdownParam[] = [] + user: AuthUser constructor ( - private serverService: ServerService - ) {} + private screenService: ScreenService + ) { } - isVideoImportEnabled () { - return this.serverService.getConfig().import.video.http.enabled + get isBroadcastMessageDisplayed () { + return this.screenService.isBroadcastMessageDisplayed + } + + ngOnInit (): void { + this.buildMenu() + } + + private buildMenu () { + const moderationEntries: TopMenuDropdownParam = { + label: $localize`Moderation`, + children: [ + { + label: $localize`Muted accounts`, + routerLink: '/my-account/blocklist/accounts', + iconName: 'user-x' + }, + { + label: $localize`Muted servers`, + routerLink: '/my-account/blocklist/servers', + iconName: 'peertube-x' + }, + { + label: $localize`Abuse reports`, + routerLink: '/my-account/abuses', + iconName: 'flag' + } + ] + } + + this.menuEntries = [ + { + label: $localize`Settings`, + routerLink: '/my-account/settings' + }, + + { + label: $localize`Notifications`, + routerLink: '/my-account/notifications' + }, + + { + label: $localize`Applications`, + routerLink: '/my-account/applications' + }, + + moderationEntries + ] } }