]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+my-account/my-account.component.ts
Merge branch 'release/4.2.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / my-account.component.ts
1 import { Component, OnInit } from '@angular/core'
2 import { AuthUser, ScreenService } from '@app/core'
3 import { TopMenuDropdownParam } from '../shared/shared-main/misc/top-menu-dropdown.component'
4
5 @Component({
6 selector: 'my-my-account',
7 templateUrl: './my-account.component.html',
8 styleUrls: [ './my-account.component.scss' ]
9 })
10 export class MyAccountComponent implements OnInit {
11 menuEntries: TopMenuDropdownParam[] = []
12 user: AuthUser
13
14 constructor (
15 private screenService: ScreenService
16 ) { }
17
18 get isBroadcastMessageDisplayed () {
19 return this.screenService.isBroadcastMessageDisplayed
20 }
21
22 ngOnInit (): void {
23 this.buildMenu()
24 }
25
26 private buildMenu () {
27 const moderationEntries: TopMenuDropdownParam = {
28 label: $localize`Moderation`,
29 children: [
30 {
31 label: $localize`Muted accounts`,
32 routerLink: '/my-account/blocklist/accounts',
33 iconName: 'user-x'
34 },
35 {
36 label: $localize`Muted servers`,
37 routerLink: '/my-account/blocklist/servers',
38 iconName: 'peertube-x'
39 },
40 {
41 label: $localize`Abuse reports`,
42 routerLink: '/my-account/abuses',
43 iconName: 'flag'
44 }
45 ]
46 }
47
48 this.menuEntries = [
49 {
50 label: $localize`Settings`,
51 routerLink: '/my-account/settings'
52 },
53
54 {
55 label: $localize`Notifications`,
56 routerLink: '/my-account/notifications'
57 },
58
59 {
60 label: $localize`Applications`,
61 routerLink: '/my-account/applications'
62 },
63
64 moderationEntries
65 ]
66 }
67 }