Skip to content

Commit 3d41769

Browse files
committed
update stylings
1 parent 4b20310 commit 3d41769

File tree

6 files changed

+23
-27
lines changed

6 files changed

+23
-27
lines changed

components/blog/BlogPostsContainer.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Link from 'next/link';
55
import styles from '@/styles/Blog.module.scss';
66
import RevealContentContainer from '@/components/containers/RevealContentContainer';
77
import { tagToHeading } from '@/utils/blogCategories';
8+
import Container from '@/components/containers/Container';
89

910
function* splitPosts(arr, n) {
1011
for (let i = 0; i < arr.length; i += n) {
@@ -44,11 +45,13 @@ const BlogPostsContainer = ({
4445
))}
4546
</>
4647
) : (
47-
<div className={styles.postContainer}>
48-
{posts.map((p, index) => (
49-
<Card customClass='blog' key={index} card={p} />
50-
))}
51-
</div>
48+
<Container>
49+
<div className={styles.postContainer}>
50+
{posts.map((p, index) => (
51+
<Card customClass='blog' key={index} card={p} />
52+
))}
53+
</div>
54+
</Container>
5255
)
5356
}
5457
{viewall ? (

components/snippets/Title.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import styles from '@/styles/Title.module.scss';
2+
import Container from '@/components/containers/Container';
23

34
const Title = ({ title, customClass }) => {
4-
return (
5+
const Content = () => (
56
<h2
67
className={
78
customClass ? `${styles.title} ${styles[customClass]}` : styles.title
@@ -10,6 +11,14 @@ const Title = ({ title, customClass }) => {
1011
{title}
1112
</h2>
1213
);
14+
15+
return customClass === 'blogTitle' ? (
16+
<Container>
17+
<Content />
18+
</Container>
19+
) : (
20+
<Content />
21+
);
1322
};
1423

1524
export default Title;

pages/blog/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function Blog({ posts }) {
1212
);
1313

1414
return (
15-
<Container>
15+
<>
1616
<div className={styles.blogSearch}>
1717
<Title customClass='blogTitle' title='Latest Posts' />
1818
{/*
@@ -22,7 +22,7 @@ export default function Blog({ posts }) {
2222
<BlogPostsContainer posts={latestPosts} />
2323
<BlogPostsContainer posts={nextJsPosts} tag='nextjs' />
2424
<BlogPostsContainer posts={typescriptPosts} tag='typescript' />
25-
</Container>
25+
</>
2626
);
2727
}
2828

styles/Blog.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545

4646
@include desktop {
4747
justify-content: flex-start;
48-
margin-left: 4rem;
4948
}
5049
}
5150

@@ -59,7 +58,8 @@
5958
}
6059

6160
@include desktop {
62-
flex-basis: 22%;
61+
flex-basis: 32%;
62+
max-width: 200px;
6363
}
6464
}
6565

styles/Card.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
}
117117

118118
&.blog {
119+
margin: 1rem 0.5rem 0 0.5rem;
119120
.card__image {
120121
height: 12rem;
121122
}

styles/Title.module.scss

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,5 @@
44
.title {
55
&.blogTitle {
66
align-self: flex-start;
7-
8-
@include mobile {
9-
margin-left: 5rem;
10-
font-size: 2.5rem;
11-
}
12-
13-
@include tablet {
14-
margin-left: 5.5rem;
15-
}
16-
17-
@include desktop {
18-
margin-left: 6.5rem;
19-
}
20-
21-
@include medium-desktop {
22-
margin-left: 7.5rem;
23-
}
247
}
258
}

0 commit comments

Comments
 (0)