diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-09-05 20:52:43 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-09-05 20:53:02 +0900 |
| commit | 82d3cf35c3c6b85b48c94dd6301c8bf718669b8d (patch) | |
| tree | c09c53a3ae1f51aba02902d4f32ffafdf7fb562a /frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | |
| parent | dd1c68425120fca008a3b10991c865ea586c7002 (diff) | |
| download | iosdc-japan-2025-albatross-82d3cf35c3c6b85b48c94dd6301c8bf718669b8d.tar.gz iosdc-japan-2025-albatross-82d3cf35c3c6b85b48c94dd6301c8bf718669b8d.tar.zst iosdc-japan-2025-albatross-82d3cf35c3c6b85b48c94dd6301c8bf718669b8d.zip | |
feat(frontend): support swift language
Diffstat (limited to 'frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx')
| -rw-r--r-- | frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index 86b2379..9eab91e 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -8,6 +8,7 @@ import { statusAtom, } from "../../states/play"; import type { PlayerProfile } from "../../types/PlayerProfile"; +import type { SupportedLanguage } from "../../types/SupportedLanguage"; import BorderedContainer from "../BorderedContainer"; import LeftTime from "../Gaming/LeftTime"; import ProblemColumn from "../Gaming/ProblemColumn"; @@ -22,6 +23,7 @@ type Props = { playerProfile: PlayerProfile; problemTitle: string; problemDescription: string; + problemLanguage: SupportedLanguage; sampleCode: string; initialCode: string; onCodeChange: (code: string) => void; @@ -34,6 +36,7 @@ export default function GolfPlayAppGaming({ playerProfile, problemTitle, problemDescription, + problemLanguage, sampleCode, initialCode, onCodeChange, @@ -44,11 +47,13 @@ export default function GolfPlayAppGaming({ const score = useAtomValue(scoreAtom); const status = useAtomValue(statusAtom); - const [codeSize, setCodeSize] = useState(calcCodeSize(initialCode)); + const [codeSize, setCodeSize] = useState( + calcCodeSize(initialCode, problemLanguage), + ); const textareaRef = useRef<HTMLTextAreaElement>(null); const handleTextChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => { - setCodeSize(calcCodeSize(e.target.value)); + setCodeSize(calcCodeSize(e.target.value, problemLanguage)); if (!isFinished) { onCodeChange(e.target.value); } @@ -91,6 +96,7 @@ export default function GolfPlayAppGaming({ <ProblemColumn title={problemTitle} description={problemDescription} + language={problemLanguage} sampleCode={sampleCode} /> <TitledColumn title="ソースコード"> |
