mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-15 01:25:28 +01:00
page template
This commit is contained in:
parent
782f597db8
commit
e77b33d6a6
@ -1,20 +1,21 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { Link } from 'gatsby'
|
import { Link } from 'gatsby'
|
||||||
import Layout from '../components/Layout'
|
import Page from '../templates/Page'
|
||||||
import styles from './404.module.scss'
|
import styles from './404.module.scss'
|
||||||
|
|
||||||
const NotFound = ({ location }) => (
|
const NotFound = () => (
|
||||||
<Layout location={location}>
|
<Page title="404 - Not Found">
|
||||||
<div className={styles.hal9000} />
|
<div className={styles.hal9000} />
|
||||||
|
|
||||||
<div className={styles.wrapper}>
|
<div className={styles.wrapper}>
|
||||||
<h1 className={styles.title}>I am sorry Dave,</h1>
|
{/* eslint-disable-next-line quotes */}
|
||||||
<p className={styles.text}>I am afraid I can not do that.</p>
|
<h1 className={styles.title}>{"I'm sorry Dave"}</h1>{' '}
|
||||||
|
{/* eslint-disable-next-line quotes */}
|
||||||
|
<p className={styles.text}>{"I'm afraid I can't do that"}</p>
|
||||||
<Link to={'/'}>Back to homepage</Link>
|
<Link to={'/'}>Back to homepage</Link>
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Page>
|
||||||
)
|
)
|
||||||
|
|
||||||
NotFound.propTypes = {
|
NotFound.propTypes = {
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin-bottom: $spacer * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { graphql, Link } from 'gatsby'
|
import { graphql, Link } from 'gatsby'
|
||||||
import Layout from '../components/Layout'
|
|
||||||
import Image from '../components/atoms/Image'
|
import Image from '../components/atoms/Image'
|
||||||
|
import Page from '../templates/Page'
|
||||||
|
|
||||||
import styles from './goodies.module.scss'
|
import styles from './goodies.module.scss'
|
||||||
|
|
||||||
const Goodies = ({ data, location }) => {
|
const Goodies = ({ data }) => {
|
||||||
const edges = data.goodies.edges
|
const edges = data.goodies.edges
|
||||||
|
|
||||||
const GoodiesThumbs = edges.map(({ node }) => {
|
const GoodiesThumbs = edges.map(({ node }) => {
|
||||||
@ -28,10 +28,9 @@ const Goodies = ({ data, location }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout location={location}>
|
<Page title="Goodies">
|
||||||
<h1 className={styles.pageTitle}>Goodies</h1>
|
|
||||||
<section className={styles.goodies}>{GoodiesThumbs}</section>
|
<section className={styles.goodies}>{GoodiesThumbs}</section>
|
||||||
</Layout>
|
</Page>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,11 +15,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pageTitle {
|
|
||||||
composes: archiveTitle from '../templates/Posts.module.scss';
|
|
||||||
margin-bottom: $spacer * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: $font-size-h3;
|
font-size: $font-size-h3;
|
||||||
color: $brand-grey;
|
color: $brand-grey;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { graphql, Link } from 'gatsby'
|
import { graphql, Link } from 'gatsby'
|
||||||
import Layout from '../components/Layout'
|
|
||||||
import Image from '../components/atoms/Image'
|
import Image from '../components/atoms/Image'
|
||||||
|
import Page from '../templates/Page'
|
||||||
|
|
||||||
import styles from './photos.module.scss'
|
import styles from './photos.module.scss'
|
||||||
|
|
||||||
const Photos = ({ data, location }) => {
|
const Photos = ({ data }) => {
|
||||||
const edges = data.photos.edges
|
const edges = data.photos.edges
|
||||||
|
|
||||||
const PhotoThumbs = edges.map(({ node }) => {
|
const PhotoThumbs = edges.map(({ node }) => {
|
||||||
@ -25,10 +25,9 @@ const Photos = ({ data, location }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout location={location}>
|
<Page title="Photos">
|
||||||
<h1 className={styles.pageTitle}>Photos</h1>
|
|
||||||
<section className={styles.photos}>{PhotoThumbs}</section>
|
<section className={styles.photos}>{PhotoThumbs}</section>
|
||||||
</Layout>
|
</Page>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,3 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pageTitle {
|
|
||||||
composes: archiveTitle from '../templates/Posts.module.scss';
|
|
||||||
margin-bottom: $spacer * 2;
|
|
||||||
}
|
|
||||||
|
22
src/templates/Page.jsx
Normal file
22
src/templates/Page.jsx
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
|
import Layout from '../components/Layout'
|
||||||
|
|
||||||
|
import styles from './Page.module.scss'
|
||||||
|
|
||||||
|
const Page = ({ title, location, children }) => {
|
||||||
|
return (
|
||||||
|
<Layout location={location}>
|
||||||
|
<h1 className={styles.pageTitle}>{title}</h1>
|
||||||
|
{children}
|
||||||
|
</Layout>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
Page.propTypes = {
|
||||||
|
location: PropTypes.object,
|
||||||
|
children: PropTypes.any.isRequired,
|
||||||
|
title: PropTypes.string.isRequired
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Page
|
6
src/templates/Page.module.scss
Normal file
6
src/templates/Page.module.scss
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
@import 'variables';
|
||||||
|
|
||||||
|
.pageTitle {
|
||||||
|
composes: archiveTitle from '../templates/Posts.module.scss';
|
||||||
|
margin-bottom: $spacer * 2;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user