feat(join): hide join button if already on a room
This commit is contained in:
committed by
Sparsh Goenka
parent
db4a58c3e6
commit
e285fa4801
@@ -21,6 +21,7 @@
|
|||||||
>
|
>
|
||||||
<div class="space-y-4 max-w-[70%]">
|
<div class="space-y-4 max-w-[70%]">
|
||||||
{#if roomCode}
|
{#if roomCode}
|
||||||
|
<div class="text-center text-lg text-primary-content">Share this code with your opponent to play</div>
|
||||||
<div class="space-x-2 flex flex-row justify-center items-center">
|
<div class="space-x-2 flex flex-row justify-center items-center">
|
||||||
<div
|
<div
|
||||||
class="text-3xl font-bold tracking-widest text-secondary-content font-mono bg-secondary py-3 rounded-full px-12"
|
class="text-3xl font-bold tracking-widest text-secondary-content font-mono bg-secondary py-3 rounded-full px-12"
|
||||||
@@ -40,21 +41,23 @@
|
|||||||
Create Room
|
Create Room
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="text-center text-lg text-primary-content">OR</div>
|
{#if !roomCode}
|
||||||
<div class="space-y-2">
|
<div class="text-center text-lg text-primary-content">OR</div>
|
||||||
<input
|
<div class="space-y-2">
|
||||||
type="text"
|
<input
|
||||||
placeholder="Enter code"
|
type="text"
|
||||||
maxlength="4"
|
placeholder="Enter code"
|
||||||
bind:value={joinCode}
|
maxlength="4"
|
||||||
class="input input-bordered input-primary uppercase tracking-widest placeholder-primary text-neutral text-center font-bold text-xl lg:text-3xl w-full glass"
|
bind:value={joinCode}
|
||||||
/>
|
class="input input-bordered input-primary uppercase tracking-widest placeholder-primary text-neutral text-center font-bold text-xl lg:text-3xl w-full glass"
|
||||||
<button
|
/>
|
||||||
onclick={() => joinRoom(joinCode)}
|
<button
|
||||||
class="w-full btn btn-outline btn-neutral text-neutral hover:border-neutral hover:bg-transparent text-xl"
|
onclick={() => joinRoom(joinCode)}
|
||||||
>
|
class="w-full btn btn-outline btn-neutral text-neutral hover:border-neutral hover:bg-transparent text-xl"
|
||||||
Join Room
|
>
|
||||||
</button>
|
Join Room
|
||||||
</div>
|
</button>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user