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="black">Black</option>
|
||||
</select>
|
||||
<button className={"btn" + (buttonLoading ? " loading" : "")} type="submit">
|
||||
<button
|
||||
className={
|
||||
"btn" + (buttonLoading ? " loading" : "") + (!session?.user?.id ? " btn-disabled" : "")
|
||||
}
|
||||
type="submit"
|
||||
>
|
||||
Create
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -53,7 +53,14 @@ export default function JoinGame() {
|
||||
name="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
|
||||
</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user