diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-03-10 03:01:44 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-03-10 03:33:22 +0900 |
| commit | a3a2bc9dc1c339e26cf93e3b510f280acaab5027 (patch) | |
| tree | 91537e7a9bf9d3edf462e278b0415f17b39192d7 /frontend/app/routes | |
| parent | c44b3383a7e55553cc95bba7bd5574f71c2e3406 (diff) | |
| download | phperkaigi-2025-albatross-a3a2bc9dc1c339e26cf93e3b510f280acaab5027.tar.gz phperkaigi-2025-albatross-a3a2bc9dc1c339e26cf93e3b510f280acaab5027.tar.zst phperkaigi-2025-albatross-a3a2bc9dc1c339e26cf93e3b510f280acaab5027.zip | |
feat(fontend): migrate from Remix to React Router
Diffstat (limited to 'frontend/app/routes')
| -rw-r--r-- | frontend/app/routes/_index.tsx | 2 | ||||
| -rw-r--r-- | frontend/app/routes/dashboard.tsx | 4 | ||||
| -rw-r--r-- | frontend/app/routes/golf.$gameId.play.tsx | 4 | ||||
| -rw-r--r-- | frontend/app/routes/golf.$gameId.watch.tsx | 4 | ||||
| -rw-r--r-- | frontend/app/routes/login.tsx | 8 | ||||
| -rw-r--r-- | frontend/app/routes/logout.tsx | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/frontend/app/routes/_index.tsx b/frontend/app/routes/_index.tsx index 06cca78..651a61c 100644 --- a/frontend/app/routes/_index.tsx +++ b/frontend/app/routes/_index.tsx @@ -1,4 +1,4 @@ -import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; +import type { LoaderFunctionArgs, MetaFunction } from "react-router"; import { ensureUserNotLoggedIn } from "../.server/auth"; import BorderedContainer from "../components/BorderedContainer"; import NavigateLink from "../components/NavigateLink"; diff --git a/frontend/app/routes/dashboard.tsx b/frontend/app/routes/dashboard.tsx index ab170b5..78ed531 100644 --- a/frontend/app/routes/dashboard.tsx +++ b/frontend/app/routes/dashboard.tsx @@ -1,5 +1,5 @@ -import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; -import { Form, useLoaderData } from "@remix-run/react"; +import type { LoaderFunctionArgs, MetaFunction } from "react-router"; +import { Form, useLoaderData } from "react-router"; import { ensureUserLoggedIn } from "../.server/auth"; import { apiGetGames } from "../api/client"; import BorderedContainer from "../components/BorderedContainer"; diff --git a/frontend/app/routes/golf.$gameId.play.tsx b/frontend/app/routes/golf.$gameId.play.tsx index e523187..dc8eb38 100644 --- a/frontend/app/routes/golf.$gameId.play.tsx +++ b/frontend/app/routes/golf.$gameId.play.tsx @@ -1,6 +1,6 @@ -import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; -import { useLoaderData } from "@remix-run/react"; import { useHydrateAtoms } from "jotai/utils"; +import type { LoaderFunctionArgs, MetaFunction } from "react-router"; +import { useLoaderData } from "react-router"; import { ensureUserLoggedIn } from "../.server/auth"; import { ApiAuthTokenContext, diff --git a/frontend/app/routes/golf.$gameId.watch.tsx b/frontend/app/routes/golf.$gameId.watch.tsx index fed06aa..674abc4 100644 --- a/frontend/app/routes/golf.$gameId.watch.tsx +++ b/frontend/app/routes/golf.$gameId.watch.tsx @@ -1,6 +1,6 @@ -import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; -import { useLoaderData } from "@remix-run/react"; import { useHydrateAtoms } from "jotai/utils"; +import type { LoaderFunctionArgs, MetaFunction } from "react-router"; +import { useLoaderData } from "react-router"; import { ensureUserLoggedIn } from "../.server/auth"; import { ApiAuthTokenContext, diff --git a/frontend/app/routes/login.tsx b/frontend/app/routes/login.tsx index 5ca6217..dd5b9e7 100644 --- a/frontend/app/routes/login.tsx +++ b/frontend/app/routes/login.tsx @@ -2,8 +2,8 @@ import type { ActionFunctionArgs, LoaderFunctionArgs, MetaFunction, -} from "@remix-run/node"; -import { Form, json, useActionData } from "@remix-run/react"; +} from "react-router"; +import { Form, data, useActionData } from "react-router"; import { ensureUserNotLoggedIn, login } from "../.server/auth"; import BorderedContainer from "../components/BorderedContainer"; import InputText from "../components/InputText"; @@ -22,7 +22,7 @@ export async function action({ request }: ActionFunctionArgs) { const username = String(formData.get("username")); const password = String(formData.get("password")); if (username === "" || password === "") { - return json( + return data( { message: "ユーザー名またはパスワードが誤っています", errors: { @@ -40,7 +40,7 @@ export async function action({ request }: ActionFunctionArgs) { await login(request); } catch (error) { if (error instanceof Error) { - return json( + return data( { message: error.message, errors: { diff --git a/frontend/app/routes/logout.tsx b/frontend/app/routes/logout.tsx index d697be2..9616b4d 100644 --- a/frontend/app/routes/logout.tsx +++ b/frontend/app/routes/logout.tsx @@ -1,4 +1,4 @@ -import type { ActionFunctionArgs } from "@remix-run/node"; +import type { ActionFunctionArgs } from "react-router"; import { logout } from "../.server/auth"; export async function action({ request }: ActionFunctionArgs) { |
