Skip to content

Commit 09edcd7

Browse files
committed
Converted Title component
1 parent 298fbe7 commit 09edcd7

File tree

4 files changed

+15
-37
lines changed

4 files changed

+15
-37
lines changed

components/blog/BlogPostsContainer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ const BlogPostsContainer = ({
3232
<RevealContentContainer>
3333
<div className={styles.blogContainer}>
3434
{heading ? (
35-
<Title customClass='blogTitle' title={heading} />
35+
<Title blogTitle title={heading} />
3636
) : tag ? (
37-
<Title customClass='blogTitle' title={tagToHeading[tag]} />
37+
<Title blogTitle title={tagToHeading[tag]} />
3838
) : null}
3939
{
4040
// put in rows of 3 if more than 3 posts (for swipable cards)

components/snippets/Title.js

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,20 @@
1-
// import styles from '@/styles/Title.module.scss';
21
import styled from 'styled-components';
32

43
export const TitleStyle = styled.h2`
5-
color: red;
4+
${props =>
5+
props.blogTitle &&
6+
`
7+
align-self: flex-start;
8+
margin: 0 auto 1rem;
9+
width: 90%;
10+
max-width: $large-desktop-breakpoint;
11+
min-height: 5rem;
12+
color: black;
13+
`};
614
`;
715

8-
const Title = ({ title }) => {
9-
return (
10-
<div>
11-
<TitleStyle>{title}</TitleStyle>
12-
</div>
13-
);
16+
const Title = ({ title, blogTitle }) => {
17+
return <TitleStyle blogTitle={blogTitle}>{title}</TitleStyle>;
1418
};
1519

1620
export default Title;
17-
18-
// const Title = ({ title, customClass }) => {
19-
// return (
20-
// <h2
21-
// className={
22-
// customClass ? `${styles.title} ${styles[customClass]}` : styles.title
23-
// }
24-
// >
25-
// {title}
26-
// </h2>
27-
// );
28-
// };
29-
30-
// export default Title;

pages/blog/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function Blog({ posts }) {
2828
return (
2929
<>
3030
<div className={styles.blogSearch}>
31-
<Title customClass='blogTitle' title={!searchTerm && 'Latest Posts'} />
31+
<Title blogTitle title={!searchTerm && 'Latest Posts'} />
3232
<SearchBar setSearchTerm={setSearchTerm} />
3333
</div>
3434
<BlogPostsContainer {...filteredData} />

styles/Title.module.scss

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)