diff --git a/src/Components/Views/StartMenu/LayoutOptions.tsx b/src/Components/Views/StartMenu/LayoutOptions.tsx index b0db392..e9c7de9 100644 --- a/src/Components/Views/StartMenu/LayoutOptions.tsx +++ b/src/Components/Views/StartMenu/LayoutOptions.tsx @@ -1,6 +1,4 @@ -import { FormControlLabel, Radio, RadioGroup } from '@mui/material'; -import React from 'react'; -import { theme } from '../../../Data/theme'; +import { twc } from 'react-twc'; import { FivePlayers, FivePlayersSide, @@ -15,12 +13,18 @@ import { TwoPlayersOppositePortrait, TwoPlayersSameSide, } from '../../../Icons/generated/Layouts'; - -import { twc } from 'react-twc'; import OnePlayerLandscape from '../../../Icons/generated/Layouts/OnePlayerLandscape'; import { Orientation } from '../../../Types/Settings'; -const LayoutWrapper = twc.div`flex flex-row justify-center items-center self-center w-full`; +const LayoutsRadioGroup = twc.div`flex flex-row justify-center items-center gap-4 self-center w-full`; + +const Label = twc.label`flex flex-row relative max-w-[118px] hover:bg-primary-main hover:bg-opacity-5 rounded-2xl cursor-pointer`; + +const Input = twc.input`peer sr-only`; + +const IconWrapper = twc( + 'div' +)`peer-checked:fill-primary-main fill-primary-dark max-h-[200px] h-[40vmin] w-[21vmin]`; type LayoutOptionsProps = { numberOfPlayers: number; @@ -28,381 +32,212 @@ type LayoutOptionsProps = { onChange: (orientation: Orientation) => void; }; -export const LayoutOptions: React.FC = ({ +export const LayoutOptions = ({ numberOfPlayers, selectedOrientation, onChange, -}) => { - const iconWidth = '21vmin'; - const iconHeight = '40vmin'; - const iconMaxWidth = '124px'; - const iconMaxHeight = '196px'; +}: LayoutOptionsProps) => { + switch (numberOfPlayers) { + case 1: + return ( + + - const renderLayoutOptions = () => { - switch (numberOfPlayers) { - case 1: - return ( - <> - - } - checkedIcon={ - - } - TouchRippleProps={{ style: { display: 'none' } }} - style={{ maxWidth: iconMaxWidth, maxHeight: iconMaxHeight }} - /> - } - label="" - /> - + - } - checkedIcon={ - - } - TouchRippleProps={{ style: { display: 'none' } }} - style={{ maxWidth: iconMaxWidth, maxHeight: iconMaxHeight }} - /> - } - label="" + onChange={(e) => onChange(e.target.value as Orientation)} /> - - ); - case 2: - return ( - <> - + + + + + ); + case 2: + return ( + + + + + + + + ); + case 3: + return ( + + - case 4: - return ( - <> - + onChange(e.target.value as Orientation)} + /> + + + + + + ); + + case 4: + return ( + + - case 5: - return ( - <> - + onChange(e.target.value as Orientation)} + /> + + + + + + ); + + case 5: + return ( + + - case 6: - return ( - <> - + onChange(e.target.value as Orientation)} + /> + + + + + + ); + + case 6: + return ( + + + + + + ); - default: - return null; - } - }; - - return ( - - { - onChange(value as Orientation); - }} - value={selectedOrientation} - style={{ justifyContent: 'center' }} - > - {renderLayoutOptions()} - - - ); + default: + return null; + } };