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/GolfWatchApps | |
| 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/GolfWatchApps')
| -rw-r--r-- | frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx | 14 | ||||
| -rw-r--r-- | frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx | 6 |
2 files changed, 14 insertions, 6 deletions
diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx index 54a5895..f06728d 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming1v1.tsx @@ -7,6 +7,7 @@ import { latestGameStatesAtom, } from "../../states/watch"; import type { PlayerProfile } from "../../types/PlayerProfile"; +import type { SupportedLanguage } from "../../types/SupportedLanguage"; import FoldableBorderedContainerWithCaption from "../FoldableBorderedContainerWithCaption"; import CodeBlock from "../Gaming/CodeBlock"; import LeftTime from "../Gaming/LeftTime"; @@ -24,6 +25,7 @@ type Props = { playerProfileB: PlayerProfile | null; problemTitle: string; problemDescription: string; + problemLanguage: SupportedLanguage; sampleCode: string; }; @@ -33,6 +35,7 @@ export default function GolfWatchAppGaming1v1({ playerProfileB, problemTitle, problemDescription, + problemLanguage, sampleCode, }: Props) { const gameStateKind = useAtomValue(gameStateKindAtom); @@ -50,8 +53,8 @@ export default function GolfWatchAppGaming1v1({ const scoreB = stateB?.score ?? null; const statusB = stateB?.status ?? "none"; - const codeSizeA = calcCodeSize(codeA); - const codeSizeB = calcCodeSize(codeB); + const codeSizeA = calcCodeSize(codeA, problemLanguage); + const codeSizeB = calcCodeSize(codeB, problemLanguage); const gameResultKind = checkGameResultKind(gameStateKind, stateA, stateB); @@ -125,15 +128,16 @@ export default function GolfWatchAppGaming1v1({ <FoldableBorderedContainerWithCaption caption={`コードサイズ: ${codeSizeA}`} > - <CodeBlock code={codeA} language="php" /> + <CodeBlock code={codeA} language={problemLanguage} /> </FoldableBorderedContainerWithCaption> </TitledColumn> <TitledColumn title={problemTitle} className="order-1 md:order-2"> <ProblemColumnContent description={problemDescription} + language={problemLanguage} sampleCode={sampleCode} /> - <RankingTable /> + <RankingTable problemLanguage={problemLanguage} /> </TitledColumn> <TitledColumn title={<SubmitStatusLabel status={statusB} />} @@ -142,7 +146,7 @@ export default function GolfWatchAppGaming1v1({ <FoldableBorderedContainerWithCaption caption={`コードサイズ: ${codeSizeB}`} > - <CodeBlock code={codeB} language="php" /> + <CodeBlock code={codeB} language={problemLanguage} /> </FoldableBorderedContainerWithCaption> </TitledColumn> </ThreeColumnLayout> diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx index b1d6520..22c6df2 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGamingMultiplayer.tsx @@ -1,5 +1,6 @@ import { useAtomValue } from "jotai"; import { gamingLeftTimeSecondsAtom } from "../../states/watch"; +import type { SupportedLanguage } from "../../types/SupportedLanguage"; import LeftTime from "../Gaming/LeftTime"; import ProblemColumn from "../Gaming/ProblemColumn"; import RankingTable from "../Gaming/RankingTable"; @@ -10,6 +11,7 @@ type Props = { gameDisplayName: string; problemTitle: string; problemDescription: string; + problemLanguage: SupportedLanguage; sampleCode: string; }; @@ -17,6 +19,7 @@ export default function GolfWatchAppGamingMultiplayer({ gameDisplayName, problemTitle, problemDescription, + problemLanguage, sampleCode, }: Props) { const leftTimeSeconds = useAtomValue(gamingLeftTimeSecondsAtom)!; @@ -35,10 +38,11 @@ export default function GolfWatchAppGamingMultiplayer({ <ProblemColumn title={problemTitle} description={problemDescription} + language={problemLanguage} sampleCode={sampleCode} /> <TitledColumn title="順位表"> - <RankingTable /> + <RankingTable problemLanguage={problemLanguage} /> </TitledColumn> </TwoColumnLayout> </div> |
