feat(blackjack): add action indicators and loading states
This commit is contained in:
parent
d2b22b561d
commit
acdbea5a99
7 changed files with 208 additions and 27 deletions
|
@ -86,10 +86,15 @@ import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angula
|
|||
</div>
|
||||
<button
|
||||
type="submit"
|
||||
class="button-primary w-full py-2"
|
||||
[disabled]="!betForm.valid || gameInProgress"
|
||||
class="button-primary w-full py-2 relative"
|
||||
[disabled]="!betForm.valid || gameInProgress || isActionInProgress"
|
||||
>
|
||||
Neues Spiel
|
||||
<span [class.invisible]="isActionInProgress">Neues Spiel</span>
|
||||
@if (isActionInProgress) {
|
||||
<div class="absolute inset-0 flex items-center justify-center">
|
||||
<div class="w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"></div>
|
||||
</div>
|
||||
}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -101,6 +106,7 @@ export class GameInfoComponent implements OnChanges {
|
|||
@Input() balance = 0;
|
||||
@Input() currentBet = 0;
|
||||
@Input() gameInProgress = false;
|
||||
@Input() isActionInProgress = false;
|
||||
@Output() newGame = new EventEmitter<number>();
|
||||
|
||||
betForm: FormGroup;
|
||||
|
|
Reference in a new issue