2019-12-18 15:31:54 +01:00
|
|
|
import { Component, OnInit } from '@angular/core'
|
2020-11-12 15:28:54 +01:00
|
|
|
import { AuthUser, ScreenService } from '@app/core'
|
2020-07-02 09:00:17 +02:00
|
|
|
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',
|
2018-09-05 14:42:59 +02:00
|
|
|
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 {
|
2018-12-05 14:21:10 +01:00
|
|
|
menuEntries: TopMenuDropdownParam[] = []
|
2020-07-28 15:18:38 +02:00
|
|
|
user: AuthUser
|
2018-09-05 17:18:13 +02:00
|
|
|
|
2018-08-03 11:10:31 +02:00
|
|
|
constructor (
|
2020-08-12 10:40:04 +02:00
|
|
|
private screenService: ScreenService
|
2021-08-17 14:42:53 +02:00
|
|
|
) { }
|
2019-12-18 15:31:54 +01:00
|
|
|
|
2020-08-10 23:28:31 +02:00
|
|
|
get isBroadcastMessageDisplayed () {
|
|
|
|
return this.screenService.isBroadcastMessageDisplayed
|
|
|
|
}
|
|
|
|
|
2019-12-18 15:31:54 +01:00
|
|
|
ngOnInit (): void {
|
2020-11-12 15:28:54 +01:00
|
|
|
this.buildMenu()
|
2020-07-28 15:18:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private buildMenu () {
|
2020-11-12 15:28:54 +01:00
|
|
|
const moderationEntries: TopMenuDropdownParam = {
|
|
|
|
label: $localize`Moderation`,
|
2018-12-05 14:21:10 +01:00
|
|
|
children: [
|
|
|
|
{
|
2020-08-12 10:40:04 +02:00
|
|
|
label: $localize`Muted accounts`,
|
2019-03-20 13:53:51 +01:00
|
|
|
routerLink: '/my-account/blocklist/accounts',
|
2020-07-23 14:42:06 +02:00
|
|
|
iconName: 'user-x'
|
2018-12-05 14:21:10 +01:00
|
|
|
},
|
|
|
|
{
|
2020-08-12 10:40:04 +02:00
|
|
|
label: $localize`Muted servers`,
|
2019-03-20 13:53:51 +01:00
|
|
|
routerLink: '/my-account/blocklist/servers',
|
2020-07-23 14:42:06 +02:00
|
|
|
iconName: 'peertube-x'
|
2018-12-05 14:21:10 +01:00
|
|
|
},
|
2020-07-27 11:40:30 +02:00
|
|
|
{
|
2020-11-12 15:28:54 +01:00
|
|
|
label: $localize`Abuse reports`,
|
2020-07-27 11:40:30 +02:00
|
|
|
routerLink: '/my-account/abuses',
|
|
|
|
iconName: 'flag'
|
2018-12-05 14:21:10 +01:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2018-09-05 14:42:59 +02:00
|
|
|
|
2018-12-05 14:21:10 +01:00
|
|
|
this.menuEntries = [
|
|
|
|
{
|
2020-11-12 15:28:54 +01:00
|
|
|
label: $localize`Settings`,
|
2018-12-05 14:21:10 +01:00
|
|
|
routerLink: '/my-account/settings'
|
|
|
|
},
|
2020-11-12 15:28:54 +01:00
|
|
|
|
2019-01-08 11:26:41 +01:00
|
|
|
{
|
2020-11-12 15:28:54 +01:00
|
|
|
label: $localize`Notifications`,
|
2019-01-08 11:26:41 +01:00
|
|
|
routerLink: '/my-account/notifications'
|
|
|
|
},
|
2020-11-12 15:28:54 +01:00
|
|
|
|
2020-11-09 16:25:27 +01:00
|
|
|
{
|
|
|
|
label: $localize`Applications`,
|
|
|
|
routerLink: '/my-account/applications'
|
|
|
|
},
|
|
|
|
|
2020-11-12 15:28:54 +01:00
|
|
|
moderationEntries
|
2018-12-05 14:21:10 +01:00
|
|
|
]
|
2018-09-05 17:18:13 +02:00
|
|
|
}
|
2018-08-03 11:10:31 +02:00
|
|
|
}
|