1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-22 17:23:50 +01:00

more page template simplification

This commit is contained in:
Matthias Kretschmann 2018-09-16 15:45:06 +02:00
parent a7da995680
commit 4e5a99fc70
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 8 additions and 11 deletions

View File

@ -25,11 +25,7 @@ const Goodies = ({ data }) => {
)
})
return (
<Page title="Goodies">
<section className={styles.goodies}>{GoodiesThumbs}</section>
</Page>
)
return <Page title="Goodies">{GoodiesThumbs}</Page>
}
Goodies.propTypes = {

View File

@ -25,8 +25,8 @@ const Photos = ({ data }) => {
})
return (
<Page title="Photos">
<section className={styles.photos}>{PhotoThumbs}</section>
<Page title="Photos" section={styles.photos}>
{PhotoThumbs}
</Page>
)
}

View File

@ -4,19 +4,20 @@ import Layout from '../components/Layout'
import styles from './Page.module.scss'
const Page = ({ title, location, children }) => {
const Page = ({ title, location, section, children }) => {
return (
<Layout location={location}>
<h1 className={styles.pageTitle}>{title}</h1>
{children}
{section ? <section className={section}>{children}</section> : children}
</Layout>
)
}
Page.propTypes = {
location: PropTypes.object,
title: PropTypes.string.isRequired,
children: PropTypes.any.isRequired,
title: PropTypes.string.isRequired
section: PropTypes.object,
location: PropTypes.object
}
export default Page