From bc56b498ee5d6d73467a12bcf6b61c0f68f60a2b Mon Sep 17 00:00:00 2001 From: Phan Huy Tran Date: Wed, 7 May 2025 13:56:25 +0200 Subject: [PATCH] feat: add bare slots frontend, remove bun start warnings --- frontend/src/app/app.routes.ts | 5 ++ .../game/blackjack/blackjack.component.ts | 34 ++++++------ .../animated-number.component.ts | 6 +- .../game-result/game-result.component.ts | 2 +- .../feature/game/slots/slots.component.html | 52 ++++++++++++++++++ .../app/feature/game/slots/slots.component.ts | 55 +++++++++++++++++++ .../transaction-history.component.ts | 20 ++----- .../components/navbar/navbar.component.ts | 2 +- 8 files changed, 139 insertions(+), 37 deletions(-) create mode 100644 frontend/src/app/feature/game/slots/slots.component.html create mode 100644 frontend/src/app/feature/game/slots/slots.component.ts diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts index c536f8f..ce4451c 100644 --- a/frontend/src/app/app.routes.ts +++ b/frontend/src/app/app.routes.ts @@ -21,4 +21,9 @@ export const routes: Routes = [ loadComponent: () => import('./feature/game/blackjack/blackjack.component'), canActivate: [authGuard], }, + { + path: 'game/slots', + loadComponent: () => import('./feature/game/slots/slots.component'), + canActivate: [authGuard], + }, ]; diff --git a/frontend/src/app/feature/game/blackjack/blackjack.component.ts b/frontend/src/app/feature/game/blackjack/blackjack.component.ts index 3e58e25..64ef4ef 100644 --- a/frontend/src/app/feature/game/blackjack/blackjack.component.ts +++ b/frontend/src/app/feature/game/blackjack/blackjack.component.ts @@ -1,20 +1,19 @@ -import { ChangeDetectionStrategy, Component, inject, OnInit, signal } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { Router } from '@angular/router'; -import { PlayingCardComponent } from './components/playing-card/playing-card.component'; -import { DealerHandComponent } from './components/dealer-hand/dealer-hand.component'; -import { PlayerHandComponent } from './components/player-hand/player-hand.component'; -import { GameControlsComponent } from './components/game-controls/game-controls.component'; -import { GameInfoComponent } from './components/game-info/game-info.component'; -import { BlackjackGame, Card } from '@blackjack/models/blackjack.model'; -import { BlackjackService } from '@blackjack/services/blackjack.service'; -import { HttpErrorResponse } from '@angular/common/http'; -import { GameResultComponent } from '@blackjack/components/game-result/game-result.component'; -import { GameState } from '@blackjack/enum/gameState'; -import { NavbarComponent } from '@shared/components/navbar/navbar.component'; -import { UserService } from '@service/user.service'; -import { timer } from 'rxjs'; -import { DebtDialogComponent } from '@shared/components/debt-dialog/debt-dialog.component'; +import {ChangeDetectionStrategy, Component, inject, OnInit, signal} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {Router} from '@angular/router'; +import {DealerHandComponent} from './components/dealer-hand/dealer-hand.component'; +import {PlayerHandComponent} from './components/player-hand/player-hand.component'; +import {GameControlsComponent} from './components/game-controls/game-controls.component'; +import {GameInfoComponent} from './components/game-info/game-info.component'; +import {BlackjackGame, Card} from '@blackjack/models/blackjack.model'; +import {BlackjackService} from '@blackjack/services/blackjack.service'; +import {HttpErrorResponse} from '@angular/common/http'; +import {GameResultComponent} from '@blackjack/components/game-result/game-result.component'; +import {GameState} from '@blackjack/enum/gameState'; +import {NavbarComponent} from '@shared/components/navbar/navbar.component'; +import {UserService} from '@service/user.service'; +import {timer} from 'rxjs'; +import {DebtDialogComponent} from '@shared/components/debt-dialog/debt-dialog.component'; @Component({ selector: 'app-blackjack', @@ -22,7 +21,6 @@ import { DebtDialogComponent } from '@shared/components/debt-dialog/debt-dialog. imports: [ CommonModule, NavbarComponent, - PlayingCardComponent, DealerHandComponent, PlayerHandComponent, GameControlsComponent, diff --git a/frontend/src/app/feature/game/blackjack/components/animated-number/animated-number.component.ts b/frontend/src/app/feature/game/blackjack/components/animated-number/animated-number.component.ts index 7d78871..0b8cd4c 100644 --- a/frontend/src/app/feature/game/blackjack/components/animated-number/animated-number.component.ts +++ b/frontend/src/app/feature/game/blackjack/components/animated-number/animated-number.component.ts @@ -8,13 +8,13 @@ import { SimpleChanges, ViewChild, } from '@angular/core'; -import { CommonModule, CurrencyPipe } from '@angular/common'; -import { CountUp } from 'countup.js'; +import {CommonModule} from '@angular/common'; +import {CountUp} from 'countup.js'; @Component({ selector: 'app-animated-number', standalone: true, - imports: [CommonModule, CurrencyPipe], + imports: [CommonModule], template: ` {{ formattedValue }} `, changeDetection: ChangeDetectionStrategy.OnPush, }) diff --git a/frontend/src/app/feature/game/blackjack/components/game-result/game-result.component.ts b/frontend/src/app/feature/game/blackjack/components/game-result/game-result.component.ts index 74d02e4..06f2d3a 100644 --- a/frontend/src/app/feature/game/blackjack/components/game-result/game-result.component.ts +++ b/frontend/src/app/feature/game/blackjack/components/game-result/game-result.component.ts @@ -7,7 +7,7 @@ import { AnimatedNumberComponent } from '../animated-number/animated-number.comp @Component({ selector: 'app-game-result', standalone: true, - imports: [CommonModule, CurrencyPipe, AnimatedNumberComponent], + imports: [CommonModule, AnimatedNumberComponent], template: `