Fix <NoMatch /> style, add <Footer />

This commit is contained in:
Eric Jinks 2018-01-23 13:33:21 +10:00
parent 57ba1b2ec4
commit bd73926fc1
5 changed files with 41 additions and 4 deletions

View file

@ -9,6 +9,7 @@ import About from './views/About'
import Contact from './views/Contact'
import NoMatch from './views/NoMatch'
import Nav from './components/Nav'
import Footer from './components/Footer'
import GithubCorner from './components/GithubCorner'
import ServiceWorkerNotifications from './components/ServiceWorkerNotifications'
import data from './data.json'
@ -33,7 +34,7 @@ class App extends Component {
} = this.getDocument('settings', 'global')
return (
<Router>
<div>
<div className='React-Wrap'>
<ScrollToTop />
<ServiceWorkerNotifications reloadOnUpdate />
<GithubCorner url='https://github.com/Jinksi/netlify-cms-react-starter' />
@ -80,8 +81,9 @@ class App extends Component {
/>
)}
/>
<Route component={NoMatch} />
<Route render={() => <NoMatch siteUrl={siteUrl} />} />
</Switch>
<Footer />
</div>
</Router>
)

14
src/components/Footer.css Normal file
View file

@ -0,0 +1,14 @@
.Footer {
background: var(--primary);
color: white;
}
.Footer--Lower {
background: var(--primaryDark);
padding: 1rem 0;
font-weight: 100;
}
.Footer--Lower a {
color: inherit;
}

13
src/components/Footer.js Normal file
View file

@ -0,0 +1,13 @@
import React from 'react'
import './Footer.css'
export default ({ globalSettings, socialSettings, navLinks }) => (
<footer className='Footer'>
<div className='Footer--Lower'>
<div className='Container taCenter'>
<span>© 2017 All rights reserved.</span>
</div>
</div>
</footer>
)

View file

@ -2,4 +2,5 @@
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 100vh;
}

View file

@ -1,10 +1,11 @@
import React from 'react'
import PropTypes from 'prop-types'
import Helmet from 'react-helmet'
import './NoMatch.css'
export default ({ siteUrl }) => (
<div className='Page'>
const NoMatch = ({ siteUrl }) => (
<div className='NoMatch'>
<section className='Section thick'>
<div className='Container taCenter'>
<h1>404 - Page Not Found</h1>
@ -22,3 +23,9 @@ export default ({ siteUrl }) => (
</Helmet>
</div>
)
NoMatch.propTypes = {
siteUrl: PropTypes.string.isRequired
}
export default NoMatch