diff --git a/frontend/angular.json b/frontend/angular.json index d8c3879..a9f9a84 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -21,8 +21,7 @@ { "glob": "**/*", "input": "public" - }, - "src/assets" + } ], "styles": [ "src/styles.css" diff --git a/frontend/src/app/feature/home/home.component.html b/frontend/src/app/feature/home/home.component.html index 9b79a9e..b0b77d3 100644 --- a/frontend/src/app/feature/home/home.component.html +++ b/frontend/src/app/feature/home/home.component.html @@ -4,7 +4,7 @@
-
+

Alle Spiele

@@ -18,54 +18,24 @@
-
- -
-
-
- +
+
+
+ +
-
-

{{ game.name }}

- -
-
-
-
-
- - -
-
-
- -
-
-

{{ game.name }}

- -
+

{{ game.name }}

+
@@ -73,5 +43,53 @@
+ +
+
+

Konto

+
+ + + + +
+
+ + + +
+

Letzte Transaktionen

+
+
+
+

{{ transaction.status }}

+

+ {{ transaction.createdAt | date: 'd.m.y H:m' }} +

+
+ + {{ transaction.amount | currency: 'EUR' }} + +
+
+
+
diff --git a/frontend/src/app/feature/home/home.component.ts b/frontend/src/app/feature/home/home.component.ts index f032246..ef947f9 100644 --- a/frontend/src/app/feature/home/home.component.ts +++ b/frontend/src/app/feature/home/home.component.ts @@ -1,18 +1,34 @@ -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; -import { NgFor } from '@angular/common'; +import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core'; +import { AsyncPipe, CurrencyPipe, DatePipe, NgFor } from '@angular/common'; +import { DepositComponent } from '../deposit/deposit.component'; import { ActivatedRoute, Router } from '@angular/router'; +import { ConfirmationComponent } from '@shared/components/confirmation/confirmation.component'; import { Game } from 'app/model/Game'; +import { Observable } from 'rxjs'; +import { TransactionService } from '@service/transaction.service'; import format from 'ajv/dist/vocabularies/format'; +import { TransactionHistoryComponent } from '../transaction-history/transaction-history.component'; +import { TransactionData } from '../../model/TransactionData'; @Component({ selector: 'app-homepage', standalone: true, - imports: [NgFor], + imports: [ + CurrencyPipe, + NgFor, + DepositComponent, + ConfirmationComponent, + AsyncPipe, + DatePipe, + TransactionHistoryComponent, + ], templateUrl: './home.component.html', changeDetection: ChangeDetectionStrategy.OnPush, }) export default class HomeComponent implements OnInit { + isDepositModalOpen = false; isDepositSuccessful = false; + isTransactionModalOpen = false; constructor( public route: ActivatedRoute, @@ -62,10 +78,35 @@ export default class HomeComponent implements OnInit { }, ]; + allGames: Game[] = [...this.featuredGames]; + + recentTransactionData: Observable = + inject(TransactionService).getUsersTransactions(5); + + openDepositModal() { + this.isDepositModalOpen = true; + } + + closeDepositModal() { + this.isDepositModalOpen = false; + } + openDepositConfirmationModal() { this.isDepositSuccessful = true; } + openTransactionModal() { + this.isTransactionModalOpen = true; + } + + closeDepositConfirmationModal() { + this.isDepositSuccessful = false; + } + + closeTransactionModal() { + this.isTransactionModalOpen = false; + } + navigateToGame(route: string) { this.router.navigate([route]); } diff --git a/frontend/src/app/shared/components/navbar/navbar.component.html b/frontend/src/app/shared/components/navbar/navbar.component.html index 451b942..7e010fa 100644 --- a/frontend/src/app/shared/components/navbar/navbar.component.html +++ b/frontend/src/app/shared/components/navbar/navbar.component.html @@ -1,118 +1,40 @@ -