fix: fix grid item size on smaller screens
This commit is contained in:
parent
3b5bb4e00d
commit
1b43a7b4ff
2 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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} />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue