feat: join pervious game added

This commit is contained in:
shahdlala66
2026-04-19 11:14:14 +02:00
parent bc644c16e3
commit fdc0f1d73b
3 changed files with 162 additions and 4 deletions
+35 -3
View File
@@ -31,12 +31,44 @@
<small>{{ creating ? 'Creating game...' : 'Start now' }}</small>
</button>
<button type="button" class="mode mode-disabled" disabled>
<span>Future Technique</span>
<small>Placeholder</small>
<button type="button" class="mode mode-active" (click)="toggleJoinGameForm()" [disabled]="joiningGame">
<span>Join Game</span>
<small>{{ joiningGame ? 'Joining...' : 'Enter game ID' }}</small>
</button>
</div>
@if (showJoinGameForm) {
<div class="join-game-form">
<p>Enter the game ID:</p>
<div class="join-game-input-group">
<input
type="text"
class="join-game-input"
[(ngModel)]="gameIdInput"
placeholder="Paste game ID here"
[disabled]="joiningGame"
(keyup.enter)="joinGame()"
/>
<button
type="button"
class="join-game-btn join"
(click)="joinGame()"
[disabled]="joiningGame || !gameIdInput.trim()"
>
{{ joiningGame ? 'Joining...' : 'Join' }}
</button>
<button
type="button"
class="join-game-btn cancel"
(click)="clearJoinGameForm()"
[disabled]="joiningGame"
>
Cancel
</button>
</div>
</div>
}
@if (errorMessage) {
<p class="error">{{ errorMessage }}</p>
}