Skip to content

Commit e7fad62

Browse files
committed
reduce card title font size and fix tags on viewall page
1 parent 7d2c09e commit e7fad62

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

components/blog/BlogPostsContainer.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ function* splitPosts(arr, n) {
1212
}
1313
}
1414

15-
const BlogPostsContainer = ({ posts, heading, tag, swipe = true }) => {
15+
const BlogPostsContainer = ({
16+
posts,
17+
heading,
18+
tag,
19+
swipe = true,
20+
viewall = true,
21+
}) => {
1622
// process posts props (e.g. insert default image)
1723
posts.map(post => {
1824
if (!post.image) {
@@ -36,12 +42,6 @@ const BlogPostsContainer = ({ posts, heading, tag, swipe = true }) => {
3642
{[...splitPosts(posts, 3)].map((p, index) => (
3743
<CardsColumns key={index} cards={p} customClass='blog' />
3844
))}
39-
<Link
40-
className={styles.viewAll}
41-
href={tag ? `/blog/category/${tag}` : '/blog/category/all'}
42-
>
43-
view all
44-
</Link>
4545
</>
4646
) : (
4747
<div className={styles.postContainer}>
@@ -51,6 +51,14 @@ const BlogPostsContainer = ({ posts, heading, tag, swipe = true }) => {
5151
</div>
5252
)
5353
}
54+
{viewall ? (
55+
<Link
56+
className={styles.viewAll}
57+
href={tag ? `/blog/category/${tag}` : '/blog/category/all'}
58+
>
59+
view all
60+
</Link>
61+
) : null}
5462
</div>
5563
</RevealContentContainer>
5664
);

pages/blog/category/all.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ export default function BlogCategory({ posts }) {
55
posts = posts.concat(posts).concat(posts);
66

77
return (
8-
<BlogPostsContainer posts={posts} swipe={false} heading='Latest Posts' />
8+
<BlogPostsContainer
9+
posts={posts}
10+
swipe={true}
11+
heading='All Posts'
12+
viewall={false}
13+
/>
914
);
1015
}
1116

@@ -21,6 +26,7 @@ export async function getStaticProps() {
2126
content: post.description,
2227
link: post.url,
2328
linkText: 'Read more',
29+
tagList: post.tag_list,
2430
})),
2531
},
2632
};

pages/blog/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export default function Blog({ posts }) {
1515
<Container>
1616
<div className={styles.blogSearch}>
1717
<Title customClass='blogTitle' title='Latest Posts' />
18-
<SearchBar />
18+
{/*
19+
<SearchBar />
20+
*/}
1921
</div>
2022
<BlogPostsContainer posts={latestPosts} />
2123
<BlogPostsContainer posts={nextJsPosts} tag='nextjs' />

styles/Card.module.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,15 @@
127127
}
128128

129129
.title {
130-
height: 6.5rem;
130+
font-size: 1.3rem;
131+
margin-bottom: 0.7rem;
132+
max-height: 6rem;
131133
overflow: hidden;
132134
}
135+
136+
&.swiper-wrapper {
137+
justify-content: flex-start;
138+
}
133139
}
134140

135141
.tagListContainer {

0 commit comments

Comments
 (0)