Skip to content

Commit 061c3f1

Browse files
committed
scrollable block takes up all available space on laptop/desktop
1 parent 489e6c9 commit 061c3f1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/frontend/src/pages/HomePage/components/ScrollablePageBlock.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, Card, CardContent, Typography, useTheme } from '@mui/material';
1+
import { Box, Card, CardContent, Typography, useMediaQuery, useTheme } from '@mui/material';
22
import React from 'react';
33

44
interface ScrollablePageBlockProps {
@@ -9,11 +9,13 @@ interface ScrollablePageBlockProps {
99

1010
const ScrollablePageBlock: React.FC<ScrollablePageBlockProps> = ({ children, title, horizontal }) => {
1111
const theme = useTheme();
12+
const isMobilePortrait = useMediaQuery('(max-width:600px)');
13+
1214
return (
1315
<Card
1416
sx={{
1517
height: '100%',
16-
width: 'fit-content',
18+
width: isMobilePortrait ? 'fit-content' : '100%',
1719
maxWidth: '100%',
1820
background: theme.palette.background.paper
1921
}}

0 commit comments

Comments
 (0)