PeerTube/client/src/app/+my-account/my-account.component.ts

68 lines
1.6 KiB
TypeScript
Raw Normal View History

2019-12-18 15:31:54 +01:00
import { Component, OnInit } from '@angular/core'
import { AuthUser, ScreenService } from '@app/core'
import { TopMenuDropdownParam } from '../shared/shared-main/misc/top-menu-dropdown.component'
2018-04-23 16:16:05 +02:00
@Component({
2018-04-24 15:10:54 +02:00
selector: 'my-my-account',
templateUrl: './my-account.component.html',
styleUrls: [ './my-account.component.scss' ]
2018-04-23 16:16:05 +02:00
})
2019-12-18 15:31:54 +01:00
export class MyAccountComponent implements OnInit {
menuEntries: TopMenuDropdownParam[] = []
user: AuthUser
2018-09-05 17:18:13 +02:00
2018-08-03 11:10:31 +02:00
constructor (
private screenService: ScreenService
) { }
2019-12-18 15:31:54 +01:00
get isBroadcastMessageDisplayed () {
return this.screenService.isBroadcastMessageDisplayed
}
2019-12-18 15:31:54 +01:00
ngOnInit (): void {
this.buildMenu()
}
private buildMenu () {
const moderationEntries: TopMenuDropdownParam = {
label: $localize`Moderation`,
children: [
{
label: $localize`Muted accounts`,
2019-03-20 13:53:51 +01:00
routerLink: '/my-account/blocklist/accounts',
iconName: 'user-x'
},
{
label: $localize`Muted servers`,
2019-03-20 13:53:51 +01:00
routerLink: '/my-account/blocklist/servers',
iconName: 'peertube-x'
},
{
label: $localize`Abuse reports`,
routerLink: '/my-account/abuses',
iconName: 'flag'
},
{
label: $localize`Applications`,
routerLink: '/my-account/applications',
iconName: 'codesandbox'
}
]
}
this.menuEntries = [
{
label: $localize`Settings`,
routerLink: '/my-account/settings'
},
2019-01-08 11:26:41 +01:00
{
label: $localize`Notifications`,
2019-01-08 11:26:41 +01:00
routerLink: '/my-account/notifications'
},
moderationEntries
]
2018-09-05 17:18:13 +02:00
}
2018-08-03 11:10:31 +02:00
}