Skip to content

Commit

Permalink
Adjust posts page to mobile (#440)
Browse files Browse the repository at this point in the history
* Adjust posts page to mobile

* fix scrollbar on open post details

* let post details take 6 columns on lg+

---------

Co-authored-by: rtrembecky <[email protected]>
  • Loading branch information
Matushl and rtrembecky authored Nov 22, 2024
1 parent 7f5d229 commit ad3870b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/Posts/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export const Post: FC<IPost> = ({caption, short_text, links, details, added_at,

<Typography variant="postBody">{short_text}</Typography>

<Stack direction="row" justifyContent="space-between" gap={0.5}>
<Stack direction="row" justifyContent="space-between" gap={0.5} mt={0.5}>
{/* alignItems so the links don't stretch */}
<Stack gap={0.5} alignItems="start">
<Stack gap={0.5} alignItems="start" ml="-10px">
{details.length > 0 && (
<Button type="button" onClick={openDetail} variant="button2">
Podrobnosti
Expand Down
8 changes: 4 additions & 4 deletions src/components/Posts/Posts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const Posts: FC = () => {
- druhy grid su prispevky od rozbaleneho prispevku - dva grid itemy ako jeden stlpec prispevkov (`xs={4}`) a druhy stlpec ako detail prispevku (`xs={5}` - detail je sirsi) */}
{activePostDetailIndex !== 0 && (
<Grid container disableEqualOverflow columnSpacing={5} mb={5}>
<Grid xs={4}>
<Grid xs={12} sm={6} md={4}>
<Stack gap={5}>
{posts.slice(0, activePostDetailIndex).map((post, index) => {
if (!post.sites.includes(seminarId)) return null
Expand All @@ -48,8 +48,8 @@ export const Posts: FC = () => {
</Grid>
)}
{activePostDetailIndex !== undefined && (
<Grid container columnSpacing={5}>
<Grid xs={4}>
<Grid container disableEqualOverflow columnSpacing={5}>
<Grid xs={12} sm={6} md={4}>
<Stack gap={5}>
{posts.slice(activePostDetailIndex).map((post, index) => {
if (!post.sites.includes(seminarId)) return null
Expand All @@ -63,7 +63,7 @@ export const Posts: FC = () => {
})}
</Stack>
</Grid>
<Grid xs={5}>
<Grid xs={12} sm={6} mt={{xs: 2, sm: 0}}>
<PostDetail caption={posts[activePostDetailIndex].caption} details={posts[activePostDetailIndex].details} />
</Grid>
</Grid>
Expand Down

0 comments on commit ad3870b

Please sign in to comment.