From 1c532c76f5e3c6c0dcfa38d005b4eff245e9dbc5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 11 Aug 2024 15:59:56 +0900 Subject: feat(frontend): improve dashboard styling --- frontend/app/components/NavigateLink.tsx | 10 ++++ frontend/app/routes/_index.tsx | 9 +--- frontend/app/routes/dashboard.tsx | 81 +++++++++++++++++--------------- 3 files changed, 56 insertions(+), 44 deletions(-) create mode 100644 frontend/app/components/NavigateLink.tsx diff --git a/frontend/app/components/NavigateLink.tsx b/frontend/app/components/NavigateLink.tsx new file mode 100644 index 0000000..a94d774 --- /dev/null +++ b/frontend/app/components/NavigateLink.tsx @@ -0,0 +1,10 @@ +import { Link, LinkProps } from "@remix-run/react"; + +export default function NavigateLink(props: LinkProps) { + return ( + + ); +} diff --git a/frontend/app/routes/_index.tsx b/frontend/app/routes/_index.tsx index 9f9c2bb..9be594f 100644 --- a/frontend/app/routes/_index.tsx +++ b/frontend/app/routes/_index.tsx @@ -1,8 +1,8 @@ import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; -import { Link } from "@remix-run/react"; import "@fortawesome/fontawesome-svg-core/styles.css"; import { ensureUserNotLoggedIn } from "../.server/auth"; import BorderedContainer from "../components/BorderedContainer"; +import NavigateLink from "../components/NavigateLink"; export const meta: MetaFunction = () => [ { title: "iOSDC Japan 2024 Albatross.swift" }, @@ -40,12 +40,7 @@ export default function Index() {
- - ログイン - + ログイン
); diff --git a/frontend/app/routes/dashboard.tsx b/frontend/app/routes/dashboard.tsx index 37dafff..6b242c4 100644 --- a/frontend/app/routes/dashboard.tsx +++ b/frontend/app/routes/dashboard.tsx @@ -1,8 +1,10 @@ import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; import { redirect } from "@remix-run/node"; -import { Form, Link, useLoaderData } from "@remix-run/react"; +import { Form, useLoaderData } from "@remix-run/react"; import { apiGetGames } from "../.server/api/client"; import { ensureUserLoggedIn } from "../.server/auth"; +import BorderedContainer from "../components/BorderedContainer"; +import NavigateLink from "../components/NavigateLink"; export const meta: MetaFunction = () => [ { title: "Dashboard | iOSDC Japan 2024 Albatross.swift" }, @@ -28,48 +30,53 @@ export default function Dashboard() { const { user, games } = useLoaderData()!; return ( -
-
-

{user.username}

-

User

-
-
    -
  • Name: {user.display_name}
  • -
-
-

Games

-
-
    +
    +

    + {user.display_name} + @{user.username} +

    +

    試合

    + +
    +
      {games.map((game) => ( -
    • - {game.display_name} - {game.game_type === "multiplayer" ? " (Multiplayer)" : " (1v1)"} - {game.state === "closed" || game.state === "finished" ? ( - - Entry +
    • +
      + + {game.display_name} - ) : ( - - Entry - - )} + + {game.game_type === "multiplayer" ? " (マルチ)" : " (1v1)"} + +
      + + {game.state === "closed" || game.state === "finished" ? ( + + 入室 + + ) : ( + + 入室 + + )} +
    • ))}
    -
    -
    - -
    -
    +
    +
    +
    + +
    ); -- cgit v1.2.3-70-g09d2