fix: most recent posts should be cut off at right side on mobile, closes #101

This commit is contained in:
Hossein Mehrabi 2023-08-25 15:58:23 +03:30
parent 50baeb2572
commit ddbc33dc32
No known key found for this signature in database
GPG Key ID: 45C04964191AFAA1
1 changed files with 109 additions and 87 deletions

View File

@ -3,6 +3,7 @@ import styled from '@emotion/styled'
import React, { useMemo } from 'react'
import { Hero } from '../../components/Hero'
import { PostsGrid } from '../../components/PostsGrid'
import { uiConfigs } from '../../configs/ui.configs'
import { useRecentPosts } from '../../queries/useRecentPosts.query'
import { LPE } from '../../types/lpe.types'
import { lsdUtils } from '../../utils/lsd.utils'
@ -35,6 +36,8 @@ export const HomePage: React.FC<HomePageProps> = ({
return (
<Root {...props}>
<Hero tags={tags} />
<MostRecentContainer>
<Container>
<PostsGrid
posts={group1}
horizontal
@ -55,6 +58,9 @@ export const HomePage: React.FC<HomePageProps> = ({
},
]}
/>
</Container>
</MostRecentContainer>
<Container>
<PostsGrid
bordered
posts={highlighted.slice(0, 1)}
@ -130,6 +136,7 @@ export const HomePage: React.FC<HomePageProps> = ({
)}
<PodcastShowsPreview data={{ shows }} />
</Container>
</Root>
)
}
@ -164,3 +171,18 @@ const Root = styled('div')`
margin-top: 40px;
}
`
const MostRecentContainer = styled.div`
${(props) => lsdUtils.breakpoint(props.theme, 'xs', 'exact')} {
& > div {
padding: 0;
padding-left: var(--main-content-padding);
}
}
`
const Container = styled.div`
@media (max-width: ${uiConfigs.maxContainerWidth}px) {
padding: 0 var(--main-content-padding);
}
`