feat(ux): auto-advance on game type and race selection
- Step 4: selecting a game type immediately advances to step 5 - Step 5: selecting Endlos or a quick-pick number immediately finalizes race-to Improves flow by removing an extra click. No changes to validation. Refs #26
This commit is contained in:
@@ -612,6 +612,8 @@ const GameTypeStep = ({ onNext, onCancel, initialValue = '' }: GameTypeStepProps
|
|||||||
|
|
||||||
const handleSelect = (selectedType: string) => {
|
const handleSelect = (selectedType: string) => {
|
||||||
setGameType(selectedType);
|
setGameType(selectedType);
|
||||||
|
// Auto-advance to next step on selection
|
||||||
|
onNext(selectedType);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSubmit = (e: Event) => {
|
const handleSubmit = (e: Event) => {
|
||||||
@@ -706,7 +708,11 @@ const RaceToStep = ({ onNext, onCancel, initialValue = '', gameType }: RaceToSte
|
|||||||
|
|
||||||
const handleQuickPick = (value: number) => {
|
const handleQuickPick = (value: number) => {
|
||||||
// For endlos (endless) games, use Infinity to prevent automatic completion
|
// For endlos (endless) games, use Infinity to prevent automatic completion
|
||||||
setRaceTo(value === 0 ? 'Infinity' : value);
|
const selected = value === 0 ? 'Infinity' : value;
|
||||||
|
setRaceTo(selected);
|
||||||
|
// Auto-advance to the next step (finalize) when a quick pick is chosen
|
||||||
|
const raceToValue = selected === 'Infinity' ? Infinity : (parseInt(String(selected), 10) || 0);
|
||||||
|
onNext(raceToValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleInputChange = (e: Event) => {
|
const handleInputChange = (e: Event) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user