mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-14 17:15:18 +01:00
more page template simplification
This commit is contained in:
parent
a7da995680
commit
4e5a99fc70
@ -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 = {
|
||||
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user