check session before enabling join/create buttons
This commit is contained in:
@@ -50,7 +50,12 @@ export default function CreateGame() {
|
|||||||
<option value="white">White</option>
|
<option value="white">White</option>
|
||||||
<option value="black">Black</option>
|
<option value="black">Black</option>
|
||||||
</select>
|
</select>
|
||||||
<button className={"btn" + (buttonLoading ? " loading" : "")} type="submit">
|
<button
|
||||||
|
className={
|
||||||
|
"btn" + (buttonLoading ? " loading" : "") + (!session?.user?.id ? " btn-disabled" : "")
|
||||||
|
}
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
Create
|
Create
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,7 +53,14 @@ export default function JoinGame() {
|
|||||||
name="joinGameCode"
|
name="joinGameCode"
|
||||||
id="joinGameCode"
|
id="joinGameCode"
|
||||||
/>
|
/>
|
||||||
<button className={"btn btn-square" + (buttonLoading ? " loading" : "")} type="submit">
|
<button
|
||||||
|
className={
|
||||||
|
"btn btn-square" +
|
||||||
|
(buttonLoading ? " loading" : "") +
|
||||||
|
(!session?.user?.id ? " btn-disabled" : "")
|
||||||
|
}
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
Join
|
Join
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user