From f5b6c2f14d3521e9763ba7a356b8e87ebc6d7cd9 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Thu, 1 Aug 2024 01:19:00 +0900
Subject: feat: change procedure of game starting

---
 frontend/app/routes/admin.games_.$gameId.tsx | 39 ++++++++++++++++------------
 1 file changed, 22 insertions(+), 17 deletions(-)

(limited to 'frontend/app/routes/admin.games_.$gameId.tsx')

diff --git a/frontend/app/routes/admin.games_.$gameId.tsx b/frontend/app/routes/admin.games_.$gameId.tsx
index 244092e..ff8f136 100644
--- a/frontend/app/routes/admin.games_.$gameId.tsx
+++ b/frontend/app/routes/admin.games_.$gameId.tsx
@@ -57,7 +57,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
     action === "open"
       ? "waiting_entries"
       : action === "start"
-        ? "waiting_start"
+        ? "prepare"
         : null;
   if (!nextState) {
     throw new Error("Invalid action");
@@ -79,6 +79,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
   if (error) {
     throw new Error(error.message);
   }
+  return null;
 }
 
 export default function AdminGameEdit() {
@@ -103,22 +104,26 @@ export default function AdminGameEdit() {
         </ul>
         <div>
           <Form method="post">
-            <button
-              type="submit"
-              name="action"
-              value="open"
-              disabled={game.state !== "closed"}
-            >
-              Open
-            </button>
-            <button
-              type="submit"
-              name="action"
-              value="start"
-              disabled={game.state !== "waiting_start"}
-            >
-              Start
-            </button>
+            <div>
+              <button
+                type="submit"
+                name="action"
+                value="open"
+                disabled={game.state !== "closed"}
+              >
+                Open
+              </button>
+            </div>
+            <div>
+              <button
+                type="submit"
+                name="action"
+                value="start"
+                disabled={game.state !== "waiting_start"}
+              >
+                Start
+              </button>
+            </div>
           </Form>
         </div>
       </div>
-- 
cgit v1.3.1

