X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bmy-account%2Fmy-account.component.ts;h=eaf8a72e92d0fe2b19b8d14b495055a9d90f28ff;hb=0f7407d926cf7774f8f730dba08327569c11680c;hp=7bb461d3c9908dd918578e08942a8e520e4e17ff;hpb=62e62f118d5da57acd3494fece2e8ed357564ffe;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 7bb461d3c..eaf8a72e9 100644 --- a/client/src/app/+my-account/my-account.component.ts +++ b/client/src/app/+my-account/my-account.component.ts @@ -1,7 +1,67 @@ -import { Component } from '@angular/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 screenService: ScreenService + ) { } + + 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 + ] + } +}