From 35d1be206c6be675d92839cfa209fceb5d1b6db9 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 15 Mar 2025 21:10:51 +0900 Subject: feat(frontend): show sample code in watch page --- .../components/BorderedContainerWithCaption.tsx | 21 +++++++++++++++++++ frontend/app/components/Gaming/Problem.tsx | 24 ++++++++++++++++++++++ .../components/GolfPlayApps/GolfPlayAppGaming.tsx | 24 ++++++---------------- frontend/app/components/GolfWatchApp.tsx | 2 ++ .../GolfWatchApps/GolfWatchAppGaming1v1.tsx | 19 ++++++++--------- .../GolfWatchAppGamingMultiplayer.tsx | 21 ++++++++----------- 6 files changed, 69 insertions(+), 42 deletions(-) create mode 100644 frontend/app/components/BorderedContainerWithCaption.tsx create mode 100644 frontend/app/components/Gaming/Problem.tsx (limited to 'frontend') diff --git a/frontend/app/components/BorderedContainerWithCaption.tsx b/frontend/app/components/BorderedContainerWithCaption.tsx new file mode 100644 index 0000000..0fee425 --- /dev/null +++ b/frontend/app/components/BorderedContainerWithCaption.tsx @@ -0,0 +1,21 @@ +import React from "react"; +import BorderedContainer from "./BorderedContainer"; + +type Props = { + caption: string; + children: React.ReactNode; +}; + +export default function BorderedContainerWithCaption({ + caption, + children, +}: Props) { + return ( + +
+

{caption}

+ {children} +
+
+ ); +} diff --git a/frontend/app/components/Gaming/Problem.tsx b/frontend/app/components/Gaming/Problem.tsx new file mode 100644 index 0000000..1584a5a --- /dev/null +++ b/frontend/app/components/Gaming/Problem.tsx @@ -0,0 +1,24 @@ +import BorderedContainerWithCaption from "../BorderedContainerWithCaption"; +import CodeBlock from "./CodeBlock"; + +type Props = { + title: string; + description: string; + sampleCode: string; +}; + +export default function Problem({ title, description, sampleCode }: Props) { + return ( +
+
{title}
+ +
+					{description}
+				
+
+ + + +
+ ); +} diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index ec92556..5c5e149 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -8,8 +8,7 @@ import { statusAtom, } from "../../states/play"; import type { PlayerProfile } from "../../types/PlayerProfile"; -import BorderedContainer from "../BorderedContainer"; -import CodeBlock from "../Gaming/CodeBlock"; +import Problem from "../Gaming/Problem"; import SubmitResult from "../Gaming/SubmitResult"; import UserIcon from "../UserIcon"; @@ -81,22 +80,11 @@ export default function GolfPlayAppGaming({
-
-
{problemTitle}
-
- -
-								{problemDescription}
-							
-
- -
-

サンプルコード

- -
-
-
-
+