diff --git a/.gitea b/.gitea index ea6732c..70a6ee4 100644 --- a/.gitea +++ b/.gitea @@ -1 +1 @@ -@https://gitea.schwenk.online/froxxxy/bscscore/issues/8 \ No newline at end of file +@https://gitea.schwenk.online/froxxxy/bscscore/issues/9 \ No newline at end of file diff --git a/src/components/App.jsx b/src/components/App.jsx index 7437206..30135ff 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -2,7 +2,7 @@ import { h } from 'preact'; import { useState, useEffect, useCallback } from 'preact/hooks'; import GameList from './GameList.jsx'; import GameDetail from './GameDetail.jsx'; -import { Player1Step, Player2Step, Player3Step } from './NewGame.jsx'; +import { Player1Step, Player2Step, Player3Step, GameTypeStep } from './NewGame.jsx'; import Modal from './Modal.jsx'; import ValidationModal from './ValidationModal.jsx'; import GameCompletionModal from './GameCompletionModal.jsx'; @@ -214,10 +214,11 @@ const App = () => { /> )} {newGameStep === 'gameType' && ( -
-

Game Type Step (TODO)

- -
+ setNewGameStep('player3')} + initialValue={newGameData.gameType} + /> )} {newGameStep === 'raceTo' && (
diff --git a/src/components/NewGame.jsx b/src/components/NewGame.jsx index b847efc..bcb55ed 100644 --- a/src/components/NewGame.jsx +++ b/src/components/NewGame.jsx @@ -429,4 +429,58 @@ const Player3Step = ({ playerNameHistory, onNext, onCancel, initialValue = '' }) ); }; -export { Player1Step, Player2Step, Player3Step }; \ No newline at end of file +/** + * Game Type selection step for multi-step game creation wizard. + * @param {object} props + * @param {Function} props.onNext + * @param {Function} props.onCancel + * @param {string} [props.initialValue] + * @returns {import('preact').VNode} + */ +const GameTypeStep = ({ onNext, onCancel, initialValue = '' }) => { + const gameTypes = ['8-Ball', '9-Ball', '10-Ball', '14/1 endlos']; + + const handleSelect = (gameType) => { + onNext(gameType); + }; + + return ( +
+
Neues Spiel – Schritt 4/5
+
+ + + + + +
+
+ {gameTypes.map(type => ( + + ))} +
+
+ + {/* No "weiter" arrow, selection proceeds automatically */} +
{/* Placeholder to balance the flex container */} +
+
+ ); +}; + +export { Player1Step, Player2Step, Player3Step, GameTypeStep }; \ No newline at end of file diff --git a/src/components/NewGame.module.css b/src/components/NewGame.module.css index 4ff712b..af65ba8 100644 --- a/src/components/NewGame.module.css +++ b/src/components/NewGame.module.css @@ -188,4 +188,31 @@ .clear-input-btn:active, .clear-input-btn:focus { color: #fff; outline: none; +} +.game-type-selection { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 16px; + width: 100%; + margin: 16px 0; +} +.game-type-btn { + background: #2a2a2a; + border: 2px solid #333; + color: #fff; + font-size: 1.4rem; + font-weight: 600; + padding: 24px; + border-radius: 8px; + cursor: pointer; + text-align: center; + transition: background 0.2s, border-color 0.2s; +} +.game-type-btn:hover { + background: #333; + border-color: #555; +} +.game-type-btn.selected { + background: #4a4a4a; + border-color: #777; } \ No newline at end of file