1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-15 01:25:28 +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 ( return <Page title="Goodies">{GoodiesThumbs}</Page>
<Page title="Goodies">
<section className={styles.goodies}>{GoodiesThumbs}</section>
</Page>
)
} }
Goodies.propTypes = { Goodies.propTypes = {

View File

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

View File

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