-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
414 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1 @@ | ||
<ng-container *appDataLoad="data$; callback: loadedData$"> | ||
@switch (apiService.user() != null) { | ||
@case (true) { | ||
<router-outlet></router-outlet> | ||
} | ||
@case (false) { | ||
<app-login></app-login> | ||
} | ||
} | ||
</ng-container> | ||
<router-outlet></router-outlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +0,0 @@ | ||
:host { | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
max-width: 100vw; | ||
overflow-x: hidden; | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,11 @@ | ||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; | ||
import { forkJoin, of, Subject } from 'rxjs'; | ||
import { catchError } from 'rxjs/operators'; | ||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { RouterOutlet } from '@angular/router'; | ||
import { ApiService, AppInfo, User } from './services/api.service'; | ||
import { DataLoadDirective } from './common/data-load/data-load.directive'; | ||
|
||
import { LoginComponent } from './pages/login/login.component'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
imports: [DataLoadDirective, RouterOutlet, LoginComponent], | ||
imports: [RouterOutlet], | ||
}) | ||
export class AppComponent { | ||
protected apiService = inject(ApiService); | ||
|
||
readonly data$ = forkJoin([ | ||
this.apiService.loadAppInfo(), | ||
this.apiService.loadUser().pipe(catchError(() => of(null))), | ||
]); | ||
readonly loadedData$ = new Subject<[AppInfo, User]>(); | ||
|
||
constructor() { | ||
this.loadedData$.pipe(takeUntilDestroyed()).subscribe(data => { | ||
this.apiService.appInfo.set(data[0]); | ||
this.apiService.user.set(data[1]); | ||
}); | ||
} | ||
} | ||
export class AppComponent {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; | ||
import { provideServerRendering } from '@angular/platform-server'; | ||
import { appConfig } from './app.config'; | ||
|
||
const serverConfig: ApplicationConfig = { | ||
providers: [ | ||
provideServerRendering(), | ||
] | ||
}; | ||
|
||
export const config = mergeApplicationConfig(appConfig, serverConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
frontend/src/app/pages/landing-page/landing-page.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<a mat-button routerLink="/soundboard">Soundboard</a> |
Empty file.
11 changes: 11 additions & 0 deletions
11
frontend/src/app/pages/landing-page/landing-page.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { MatAnchor } from '@angular/material/button'; | ||
import { RouterLink } from '@angular/router'; | ||
|
||
@Component({ | ||
imports: [MatAnchor, RouterLink], | ||
templateUrl: './landing-page.component.html', | ||
styleUrl: './landing-page.component.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class LandingPageComponent {} |
10 changes: 10 additions & 0 deletions
10
frontend/src/app/pages/main-layout/main-layout.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<ng-container *appDataLoad="data$; callback: loadedData$"> | ||
@switch (apiService.user() != null) { | ||
@case (true) { | ||
<router-outlet></router-outlet> | ||
} | ||
@case (false) { | ||
<app-login></app-login> | ||
} | ||
} | ||
</ng-container> |
7 changes: 7 additions & 0 deletions
7
frontend/src/app/pages/main-layout/main-layout.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
:host { | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
max-width: 100vw; | ||
overflow-x: hidden; | ||
} |
31 changes: 31 additions & 0 deletions
31
frontend/src/app/pages/main-layout/main-layout.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; | ||
import { forkJoin, of, Subject } from 'rxjs'; | ||
import { catchError } from 'rxjs/operators'; | ||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; | ||
import { RouterOutlet } from '@angular/router'; | ||
import { ApiService, AppInfo, User } from '../../services/api.service'; | ||
import { LoginComponent } from '../login/login.component'; | ||
import { DataLoadDirective } from '../../common/data-load/data-load.directive'; | ||
|
||
@Component({ | ||
imports: [RouterOutlet, LoginComponent, DataLoadDirective], | ||
templateUrl: './main-layout.component.html', | ||
styleUrl: './main-layout.component.scss', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class MainLayoutComponent { | ||
protected apiService = inject(ApiService); | ||
|
||
readonly data$ = forkJoin([ | ||
this.apiService.loadAppInfo(), | ||
this.apiService.loadUser().pipe(catchError(() => of(null))), | ||
]); | ||
readonly loadedData$ = new Subject<[AppInfo, User]>(); | ||
|
||
constructor() { | ||
this.loadedData$.pipe(takeUntilDestroyed()).subscribe(data => { | ||
this.apiService.appInfo.set(data[0]); | ||
this.apiService.user.set(data[1]); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { bootstrapApplication } from '@angular/platform-browser'; | ||
import { AppComponent } from './app/app.component'; | ||
import { config } from './app/app.config.server'; | ||
|
||
const bootstrap = () => bootstrapApplication(AppComponent, config); | ||
|
||
export default bootstrap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { bootstrapApplication } from '@angular/platform-browser'; | ||
import { AppComponent } from './app/app.component'; | ||
import { APP_CONFIG } from './app/app.config'; | ||
import { appConfig } from './app/app.config'; | ||
|
||
bootstrapApplication(AppComponent, APP_CONFIG).catch(err => console.error(err)); | ||
bootstrapApplication(AppComponent, appConfig).catch(err => console.error(err)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters