mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-16 15:58:00 +00:00
30
src/Components/PreStartGame/PreStart.tsx
Normal file
30
src/Components/PreStartGame/PreStart.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
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';
|
||||
|
||||
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 />;
|
||||
}
|
||||
|
||||
goToStart();
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user