diff --git a/src/components/menu/AiGameSetup.tsx b/src/components/menu/AiGameSetup.tsx index a55974a..c43a60e 100644 --- a/src/components/menu/AiGameSetup.tsx +++ b/src/components/menu/AiGameSetup.tsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useGameStore } from '../../store/gameStore'; +import { MIN_BOARD_SIZE, MAX_BOARD_SIZE } from '../../core/constants'; import type { Color, GameConfig } from '../../core/types'; interface Props { @@ -11,13 +12,14 @@ interface Props { export default function AiGameSetup({ onBack, onStart }: Props) { const { t } = useTranslation(); const startGame = useGameStore((s) => s.startGame); + const [boardSize, setBoardSize] = useState(15); const [difficulty, setDifficulty] = useState(3); const [playerColor, setPlayerColor] = useState('Black'); const [useForbidden, setUseForbidden] = useState(true); const handleStart = async () => { const config: GameConfig = { - boardSize: 15, + boardSize, useForbiddenRules: useForbidden, useTimer: false, timeLimitSecs: 60, @@ -33,6 +35,14 @@ export default function AiGameSetup({ onBack, onStart }: Props) { return (

{t('menu.ai_game')}

+
diff --git a/src/components/menu/OnlineSetup.tsx b/src/components/menu/OnlineSetup.tsx index 7959cd9..ad318e5 100644 --- a/src/components/menu/OnlineSetup.tsx +++ b/src/components/menu/OnlineSetup.tsx @@ -1,6 +1,7 @@ import { useTranslation } from 'react-i18next'; import { useGameStore } from '../../store/gameStore'; import { useState } from 'react'; +import { MIN_BOARD_SIZE, MAX_BOARD_SIZE } from '../../core/constants'; import type { GameConfig } from '../../core/types'; interface Props { onBack: () => void; onStart: () => void; } @@ -9,9 +10,10 @@ export default function OnlineSetup({ onBack, onStart }: Props) { const { t } = useTranslation(); const startGame = useGameStore((s) => s.startGame); const [ip, setIp] = useState(''); + const [boardSize, setBoardSize] = useState(15); const baseConfig: GameConfig = { - boardSize: 15, useForbiddenRules: true, useTimer: false, + boardSize, useForbiddenRules: true, useTimer: false, timeLimitSecs: 60, aiDifficulty: 3, playerColor: 'Black', isServer: false, remoteAddress: '', }; @@ -29,6 +31,14 @@ export default function OnlineSetup({ onBack, onStart }: Props) { return (

{t('menu.online_game')}

+
setIp(e.target.value)} placeholder={t('menu.ip_placeholder') as string} />