aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx')
-rw-r--r--frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx17
1 files changed, 13 insertions, 4 deletions
diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
index d4a059f..bc205fb 100644
--- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
+++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
@@ -5,10 +5,11 @@ import SubmitButton from "../../components/SubmitButton";
import {
gamingLeftTimeSecondsAtom,
scoreAtom,
- submitResultAtom,
+ statusAtom,
} from "../../states/play";
import type { PlayerProfile } from "../../types/PlayerProfile";
import BorderedContainer from "../BorderedContainer";
+import CodeBlock from "../Gaming/CodeBlock";
import SubmitResult from "../Gaming/SubmitResult";
import UserIcon from "../UserIcon";
@@ -17,6 +18,7 @@ type Props = {
playerProfile: PlayerProfile;
problemTitle: string;
problemDescription: string;
+ sampleCode: string;
initialCode: string;
onCodeChange: (code: string) => void;
onCodeSubmit: (code: string) => void;
@@ -27,13 +29,14 @@ export default function GolfPlayAppGaming({
playerProfile,
problemTitle,
problemDescription,
+ sampleCode,
initialCode,
onCodeChange,
onCodeSubmit,
}: Props) {
const leftTimeSeconds = useAtomValue(gamingLeftTimeSecondsAtom)!;
const score = useAtomValue(scoreAtom);
- const submitResult = useAtomValue(submitResultAtom);
+ const status = useAtomValue(statusAtom);
const textareaRef = useRef<HTMLTextAreaElement>(null);
@@ -80,10 +83,16 @@ export default function GolfPlayAppGaming({
<div className="grow grid grid-cols-3 divide-x divide-gray-300">
<div className="p-4">
<div className="mb-2 text-xl font-bold">{problemTitle}</div>
- <div className="p-2">
+ <div className="p-2 grid gap-4">
<BorderedContainer>
<div className="text-gray-700">{problemDescription}</div>
</BorderedContainer>
+ <BorderedContainer>
+ <div>
+ <h2>サンプルコード</h2>
+ <CodeBlock code={sampleCode} language="php" />
+ </div>
+ </BorderedContainer>
</div>
</div>
<div className="p-4">
@@ -96,7 +105,7 @@ export default function GolfPlayAppGaming({
</div>
<div className="p-4">
<SubmitResult
- result={submitResult}
+ status={status}
submitButton={
<SubmitButton onClick={handleSubmitButtonClick}>
提出