feat(transaction-history): add transaction history feature with modal
This commit is contained in:
		
					parent
					
						
							
								d6077645d9
							
						
					
				
			
			
				commit
				
					
						9817fb95db
					
				
			
		
					 6 changed files with 57 additions and 12 deletions
				
			
		|  | @ -8,22 +8,26 @@ import { NavbarComponent } from '@shared/components/navbar/navbar.component'; | |||
| import { Game } from 'app/model/Game'; | ||||
| import { Observable, of } from 'rxjs'; | ||||
| import { TransactionService } from '@service/transaction.service'; | ||||
| import format from 'ajv/dist/vocabularies/format'; | ||||
| import { TransactionHistoryComponent } from '../transaction-history/transaction-history.component'; | ||||
| 
 | ||||
| @Component({ | ||||
|   selector: 'app-homepage', | ||||
|   standalone: true, | ||||
|   imports: [NavbarComponent, CurrencyPipe, NgFor, DepositComponent, ConfirmationComponent, AsyncPipe, DatePipe], | ||||
|   imports: [NavbarComponent, 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, | ||||
|     public router: Router | ||||
|   ) {} | ||||
|     public router: Router, | ||||
|   ) { | ||||
|   } | ||||
| 
 | ||||
|   ngOnInit() { | ||||
|     this.isDepositSuccessful = this.route.snapshot.queryParams['success'] == 'true'; | ||||
|  | @ -81,6 +85,7 @@ export default class HomeComponent implements OnInit { | |||
|   openDepositModal() { | ||||
|     this.isDepositModalOpen = true; | ||||
|   } | ||||
| 
 | ||||
|   closeDepositModal() { | ||||
|     this.isDepositModalOpen = false; | ||||
|   } | ||||
|  | @ -88,11 +93,23 @@ export default class HomeComponent implements OnInit { | |||
|   openDepositConfirmationModal() { | ||||
|     this.isDepositSuccessful = true; | ||||
|   } | ||||
| 
 | ||||
|   openTransactionModal() | ||||
|   { | ||||
|     this.isTransactionModalOpen = true; | ||||
|   } | ||||
| 
 | ||||
|   closeDepositConfirmationModal() { | ||||
|     this.isDepositSuccessful = false; | ||||
|   } | ||||
| 
 | ||||
|   closeTransactionModal() { | ||||
|     this.isTransactionModalOpen = false; | ||||
|   } | ||||
| 
 | ||||
|   navigateToGame(route: string) { | ||||
|     this.router.navigate([route]); | ||||
|   } | ||||
| 
 | ||||
|   protected readonly format = format; | ||||
| } | ||||
|  |  | |||
		Reference in a new issue