fix: fix grid item size on smaller screens

This commit is contained in:
Felix Schröter 2023-01-04 19:17:50 +01:00
parent 3b5bb4e00d
commit 1b43a7b4ff
Signed by: felschr
GPG key ID: 671E39E6744C807D
2 changed files with 8 additions and 2 deletions

View file

@ -24,9 +24,15 @@ const Post = ({ size = "normal", post }: PostProps) => {
` `
const featuredImage = getImage(post.frontmatter?.featuredImage?.childImageSharp?.gatsbyImageData!) const featuredImage = getImage(post.frontmatter?.featuredImage?.childImageSharp?.gatsbyImageData!)
const isHighlight = size === "highlight"
return ( return (
<Grid item xs={size === "highlight" ? 12 : 4}> <Grid
item
xs={12}
sm={isHighlight ? 12 : 6}
md={isHighlight ? 12 : 4}
>
<Card> <Card>
{featuredImage && ( {featuredImage && (
<CardMedia <CardMedia

View file

@ -84,7 +84,7 @@ const IndexPage = () => {
<Layout pageTitle="Home"> <Layout pageTitle="Home">
<Grid container spacing={2} alignItems="stretch"> <Grid container spacing={2} alignItems="stretch">
{content.map(({ title, icon, description }) => {content.map(({ title, icon, description }) =>
<Grid item xs={4}> <Grid item xs={12} sm={6} md={4}>
<Card> <Card>
<CardContent> <CardContent>
<Title Icon={icon} title={title} /> <Title Icon={icon} title={title} />