mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-13 22:56:20 +00:00
36 lines
1020 B
TypeScript
36 lines
1020 B
TypeScript
import { useGlobalSettings } from '../../Hooks/useGlobalSettings';
|
|
import { PreStartMode } from '../../Types/Settings';
|
|
import { GridLayout } from '../Views/Play';
|
|
import { FingerGame } from './Games/FingerGame';
|
|
import { RandomKingPlayers } from './Games/RandomKing/RandomKingPlayers';
|
|
import { RandomKingSelectWrapper } from './Games/RandomKing/RandomKingSelectWrapper';
|
|
import { Trivia } from './Games/Trivia';
|
|
|
|
export const PreStart = ({ gridLayout }: { gridLayout: GridLayout }) => {
|
|
const { settings, randomizingPlayer, goToStart } = useGlobalSettings();
|
|
|
|
if (settings.preStartMode === PreStartMode.RandomKing) {
|
|
if (!randomizingPlayer) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<RandomKingSelectWrapper />
|
|
<RandomKingPlayers gridLayout={gridLayout} />
|
|
</>
|
|
);
|
|
}
|
|
|
|
if (settings.preStartMode === PreStartMode.FingerGame) {
|
|
return <FingerGame />;
|
|
}
|
|
|
|
if (settings.preStartMode === PreStartMode.Trivia) {
|
|
return <Trivia />;
|
|
}
|
|
|
|
goToStart();
|
|
return null;
|
|
};
|