Skip to content

Commit

Permalink
Remove margin on Scoreboard, move correction checkbox to within Playe…
Browse files Browse the repository at this point in the history
…r component
  • Loading branch information
JessicaMulein committed Oct 17, 2024
1 parent ed1de1c commit 19d7f04
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
27 changes: 18 additions & 9 deletions src/components/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import { FailedAddLogEntryError } from '@/game/errors/failed-add-log';
import theme from '@/components/theme';

const StyledPaper = styled(Paper)(({ theme }) => ({
padding: 5,
padding: theme.spacing(2),
margin: theme.spacing(2),
position: 'relative',
}));

const ColumnBox = styled(Box)({
Expand All @@ -35,6 +36,14 @@ const CenteredTitle = styled(Box)({
marginBottom: 2,
});

const CorrectionCheckbox = styled(Box)({
position: 'absolute',
top: 8,
right: 8,
display: 'flex',
alignItems: 'center',
});

interface PlayerProps {
addLogEntry: (
playerIndex: number,
Expand Down Expand Up @@ -177,6 +186,14 @@ const Player: React.FC<PlayerProps> = ({ addLogEntry }) => {
<SettingsIcon />
</IconButton>
</Box>
<Box position="absolute" bottom={10} left={30} display="flex" alignItems="center">
<Checkbox
checked={isCorrection}
onChange={handleCorrectionChange}
inputProps={{ 'aria-label': 'Correction Checkbox' }}
/>
<Typography variant="body2">Correction</Typography>
</Box>
{player && (
<Box display="flex" flexWrap="wrap">
<ColumnBox>
Expand Down Expand Up @@ -375,14 +392,6 @@ const Player: React.FC<PlayerProps> = ({ addLogEntry }) => {
/>
</Box>
</Popover>
<Box position="absolute" bottom={10} left={30} display="flex" alignItems="center">
<Checkbox
checked={isCorrection}
onChange={handleCorrectionChange}
inputProps={{ 'aria-label': 'Correction Checkbox' }}
/>
<Typography variant="body2">Correction</Typography>
</Box>
</StyledPaper>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Scoreboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Scoreboard: React.FC = () => {
};

return (
<Paper elevation={3} sx={{ padding: 0, maxWidth: 600, margin: 'auto' }}>
<Paper elevation={3} sx={{ padding: 0, maxWidth: 600 }}>
<TableContainer>
<Table>
<TableHead>
Expand Down

0 comments on commit 19d7f04

Please sign in to comment.