Skip to content

Commit 43a27b2

Browse files
committed
Create page title component
1 parent c9317c9 commit 43a27b2

5 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
import { StyledTitle } from './PageTitle.styles'
4+
5+
const PageTitle = ({ title, description }) => (
6+
<StyledTitle>
7+
<h1>
8+
<span>{title}</span>
9+
</h1>
10+
<p>{description}</p>
11+
</StyledTitle>
12+
)
13+
14+
PageTitle.propTypes = {
15+
title: PropTypes.string.isRequired,
16+
description: PropTypes.string.isRequired,
17+
}
18+
19+
export default PageTitle
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import styled from 'styled-components'
2+
3+
export const StyledTitle = styled.header`
4+
margin-bottom: 4rem;
5+
6+
@media (max-width: 991px) {
7+
margin-bottom: 3rem;
8+
}
9+
10+
h1 {
11+
font-size: var(--font-size__h4);
12+
/* text-transform: uppercase; */
13+
margin: 0 0 1rem;
14+
color: var(--color__purple);
15+
}
16+
17+
p {
18+
margin: 0;
19+
}
20+
`

src/components/PageTitle/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as PageTitle } from './PageTitle.component'

src/pages/learning.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ import Seo from '../components/Seo'
44
import Learning from '../data/learning.json'
55
import { Sidebar } from '../components/Sidebar'
66
import { DataList } from '../components/DataList'
7+
import { PageTitle } from '../components/PageTitle'
78

89
const LearningPage = () => {
910
const { learning } = Learning
1011
return (
1112
<Layout>
1213
<Seo title="Learning" />
14+
<PageTitle
15+
description="From the basics to advanced concepts, a collection of links to various knowledge articles."
16+
title="Learning"
17+
/>
1318
<div className="wrapper">
1419
<Sidebar data={learning} page="learning" />
1520
<DataList data={learning} />

src/pages/resources.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ import Seo from '../components/Seo'
44
import Resources from '../data/resources.json'
55
import { Sidebar } from '../components/Sidebar'
66
import { DataList } from '../components/DataList'
7+
import { PageTitle } from '../components/PageTitle'
78

89
const ResourcesPage = () => {
910
const { resources } = Resources
1011
return (
1112
<Layout>
1213
<Seo title="Resources" />
14+
<PageTitle
15+
description="Links to tools, libraries, frameworks, and more to improve your development process."
16+
title="Resources"
17+
/>
1318
<div className="wrapper">
1419
<Sidebar data={resources} page="resources" />
1520
<DataList data={resources} />

0 commit comments

Comments
 (0)