Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust posts page to mobile #440

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading