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:
parent
a7da995680
commit
4e5a99fc70
@ -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 = {
|
||||||
|
@ -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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user