Skip to content

Commit

Permalink
update toastr
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Spanos committed Jun 19, 2024
1 parent 2b9c16d commit f441068
Show file tree
Hide file tree
Showing 11 changed files with 4,906 additions and 4,091 deletions.
2 changes: 1 addition & 1 deletion src/ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"styles": ["src/styles.css","node_modules/ngx-toastr/toastr.css"],
"scripts": []
},
"configurations": {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@angular/router": "^17.3.2",
"@moby-it/poker-core": "^2.1.3",
"immer": "^10.0.4",
"ngx-toastr": "^18.0.0",
"ngx-toastr": "^19.0.0",
"rxjs": "~7.8.1",
"tslib": "^2.6.2",
"zone.js": "~0.14.4"
Expand Down
8,924 changes: 4,869 additions & 4,055 deletions src/ui/pnpm-lock.yaml

Large diffs are not rendered by default.

22 changes: 10 additions & 12 deletions src/ui/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { ApplicationConfig, ErrorHandler, importProvidersFrom } from '@angular/core';
import { provideRouter } from '@angular/router';

import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { ToastrModule } from 'ngx-toastr';
import { HTTP_INTERCEPTORS, HttpClientModule, provideHttpClient } from '@angular/common/http';
import { ToastrModule, provideToastr } from 'ngx-toastr';
import { environment } from '../environments/environment';
import { routes } from './app.routes';
import { GlobalErrorHandler } from './errorHandler';
import { API_URL } from './shared/config/apiUrl.token';
import { TokenInterceptor } from './token.interceptor';
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { BrowserAnimationsModule, provideAnimations } from "@angular/platform-browser/animations";
export const appConfig: ApplicationConfig = {
providers: [
{ provide: API_URL, useValue: environment.apiUrl },
Expand All @@ -19,14 +19,12 @@ export const appConfig: ApplicationConfig = {
},
{ provide: ErrorHandler, useClass: GlobalErrorHandler },
provideRouter(routes),
importProvidersFrom([
HttpClientModule,
BrowserAnimationsModule,
ToastrModule.forRoot({
positionClass: 'toast-bottom-right',
timeOut: 5000,
closeButton: true,
}),
]),
provideAnimations(),
provideHttpClient(),
provideToastr({
positionClass: 'toast-bottom-right',
timeOut: 5000,
closeButton: true,
})
]
};
4 changes: 2 additions & 2 deletions src/ui/src/app/auth/user.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface User {
export type User = {
id: string;
username: string;
email: string;
score: number;
}
};
4 changes: 0 additions & 4 deletions src/ui/src/app/leaderboards/leaderboards.component.css

This file was deleted.

7 changes: 6 additions & 1 deletion src/ui/src/app/leaderboards/leaderboards.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import { UserScore } from './userScores.dto';
templateUrl: './leaderboards.component.html',
imports: [LeaderboardsPositionPipe],
standalone: true,
styleUrls: ['./leaderboards.component.scss'],
styles: `
:host {
display: block;
min-height: 100vh;
}
`,
})
export class LeaderboardsComponent {
constructor(
Expand Down
4 changes: 2 additions & 2 deletions src/ui/src/app/leaderboards/userScores.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface UserScore {
export type UserScore = {
username: string;
score: string;
gamesPlayed: number;
}
};
4 changes: 0 additions & 4 deletions src/ui/src/app/play/play.component.css

This file was deleted.

7 changes: 0 additions & 7 deletions src/ui/src/app/play/play.component.html

This file was deleted.

17 changes: 15 additions & 2 deletions src/ui/src/app/play/play.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ import { RevealedCardsToggleComponent } from './revealed-cards-toggle/revealed-c
@Component({
selector: 'ppo-play',
imports: [GuessBoxComponent, PokerTableComponent, RevealedCardsToggleComponent],
templateUrl: './play.component.html',
styleUrls: ['./play.component.css'],
template: `
<div class="container">
<div class="play-area">
<ppo-revealed-cards-toggle></ppo-revealed-cards-toggle>
<ppo-poker-table [round]="round()"></ppo-poker-table>
<ppo-guess-box></ppo-guess-box>
</div>
</div>
`,
styles: `
:host {
flex: 1;
display: flex;
}`,
standalone: true
})
export class PlayComponent implements OnDestroy, OnInit {
Expand All @@ -19,6 +31,7 @@ export class PlayComponent implements OnDestroy, OnInit {
private toastr: ToastrService
) { }
round = this.pokerOddsFacade.currentRound;

ngOnInit(): void {
if (this.authStore.isLoggedIn()) {
const activeToast = this.toastr.info(
Expand Down

0 comments on commit f441068

Please sign in to comment.