diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-01 02:30:20 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-01 02:30:20 +0900 |
| commit | 10b9be2c2a46b204f83be7d152ca62bf69e8843e (patch) | |
| tree | 53011badc4b62c63da407a9b9213af242ed5cf4b /frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | |
| parent | 222ed4e77c3564c95450361fdeca40a733ce65c9 (diff) | |
| parent | 1be6007f81488d0f186b44994fe8ee23385059a1 (diff) | |
| download | phperkaigi-2025-albatross-10b9be2c2a46b204f83be7d152ca62bf69e8843e.tar.gz phperkaigi-2025-albatross-10b9be2c2a46b204f83be7d152ca62bf69e8843e.tar.zst phperkaigi-2025-albatross-10b9be2c2a46b204f83be7d152ca62bf69e8843e.zip | |
Merge branch 'feat/game-screen'
Diffstat (limited to 'frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx')
| -rw-r--r-- | frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index 332cb3c..fc672f5 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -1,29 +1,40 @@ +type Props = { + problem: string; + onCodeChange: (code: string) => void; + currentScore: number | null; +}; + export default function GolfPlayAppGaming({ problem, onCodeChange, currentScore, -}: { - problem: string; - onCodeChange: (code: string) => void; - currentScore: number | null; -}) { +}: Props) { const handleTextChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => { onCodeChange(e.target.value); }; return ( - <div style={{ display: "flex" }}> - <div style={{ flex: 1, padding: "10px", borderRight: "1px solid #ccc" }}> - <div>{problem}</div> - <div> - {currentScore == null ? "Score: -" : `Score: ${currentScore}`} + <div className="min-h-screen flex"> + <div className="mx-auto flex min-h-full flex-grow"> + <div className="flex w-1/2 flex-col justify-between p-4"> + <div> + <div className="mb-2 text-xl font-bold">TODO</div> + <div className="text-gray-700">{problem}</div> + </div> + <div className="mb-4 mt-auto"> + <div className="font-semibold text-green-500"> + Score: {currentScore == null ? "-" : `${currentScore}`} + </div> + </div> + </div> + <div className="w-1/2 p-4 flex"> + <div className="flex-grow"> + <textarea + className="h-full w-full rounded-lg border border-gray-300 p-2 focus:outline-none focus:ring-2 focus:ring-blue-500" + onChange={handleTextChange} + ></textarea> + </div> </div> - </div> - <div style={{ flex: 1, padding: "10px" }}> - <textarea - style={{ width: "100%", height: "100%" }} - onChange={handleTextChange} - /> </div> </div> ); |
