]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/app.module.ts
Redesign account's channels page
[github/Chocobozzz/PeerTube.git] / client / src / app / app.module.ts
1 import 'focus-visible'
2 import { environment } from 'src/environments/environment'
3 import { APP_BASE_HREF, registerLocaleData } from '@angular/common'
4 import { NgModule } from '@angular/core'
5 import { BrowserModule } from '@angular/platform-browser'
6 import { ServiceWorkerModule } from '@angular/service-worker'
7 import { ServerService } from '@app/core'
8 import localeOc from '@app/helpers/locales/oc'
9 import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
10 import { AppRoutingModule } from './app-routing.module'
11 import { AppComponent } from './app.component'
12 import { CoreModule } from './core'
13 import { EmptyComponent } from './empty.component'
14 import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header'
15 import { HighlightPipe } from './header/highlight.pipe'
16 import { LanguageChooserComponent, MenuComponent, NotificationComponent } from './menu'
17 import { ConfirmComponent } from './modal/confirm.component'
18 import { CustomModalComponent } from './modal/custom-modal.component'
19 import { InstanceConfigWarningModalComponent } from './modal/instance-config-warning-modal.component'
20 import { QuickSettingsModalComponent } from './modal/quick-settings-modal.component'
21 import { WelcomeModalComponent } from './modal/welcome-modal.component'
22 import { SharedFormModule } from './shared/shared-forms'
23 import { SharedGlobalIconModule } from './shared/shared-icons'
24 import { SharedInstanceModule } from './shared/shared-instance'
25 import { SharedMainModule } from './shared/shared-main'
26 import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings'
27
28 registerLocaleData(localeOc, 'oc')
29
30 @NgModule({
31 bootstrap: [ AppComponent ],
32
33 declarations: [
34 AppComponent,
35 EmptyComponent,
36
37 MenuComponent,
38 LanguageChooserComponent,
39 QuickSettingsModalComponent,
40 NotificationComponent,
41 HeaderComponent,
42 SearchTypeaheadComponent,
43 SuggestionComponent,
44 HighlightPipe,
45
46 CustomModalComponent,
47 WelcomeModalComponent,
48 InstanceConfigWarningModalComponent,
49 ConfirmComponent
50 ],
51
52 imports: [
53 BrowserModule,
54 ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
55
56 CoreModule,
57 SharedMainModule,
58 SharedFormModule,
59 SharedUserInterfaceSettingsModule,
60 SharedGlobalIconModule,
61 SharedInstanceModule,
62
63 MetaModule.forRoot({
64 provide: MetaLoader,
65 useFactory: (serverService: ServerService) => {
66 return new MetaStaticLoader({
67 pageTitlePositioning: PageTitlePositioning.PrependPageTitle,
68 pageTitleSeparator: ' - ',
69 get applicationName () { return serverService.getTmpConfig().instance.name },
70 defaults: {
71 get title () { return serverService.getTmpConfig().instance.name },
72 get description () { return serverService.getTmpConfig().instance.shortDescription }
73 }
74 })
75 },
76 deps: [ ServerService ]
77 }),
78
79 AppRoutingModule // Put it after all the module because it has the 404 route
80 ],
81
82 providers: [
83 {
84 provide: APP_BASE_HREF,
85 useValue: '/'
86 }
87 ]
88 })
89 export class AppModule {}