From 7238448a90ea7b189ccf43f58193c8428bd246f9 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Thu, 15 Mar 2018 10:54:41 -0700 Subject: [PATCH] moved title and host to state from FourOhFour --- react/app.js | 2 +- react/containers/FourOhFourPage/index.jsx | 11 +++++++++++ .../index.jsx => containers/FourOhFourPage/view.jsx} | 4 ++-- react/reducers/site.js | 8 +++++++- 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 react/containers/FourOhFourPage/index.jsx rename react/{components/FourOhFourPage/index.jsx => containers/FourOhFourPage/view.jsx} (80%) diff --git a/react/app.js b/react/app.js index 8c8e00ff..137a743a 100644 --- a/react/app.js +++ b/react/app.js @@ -4,7 +4,7 @@ import HomePage from 'components/HomePage'; import AboutPage from 'components/AboutPage'; import LoginPage from 'containers/LoginPage'; import ShowPage from 'containers/ShowPage'; -import FourOhFourPage from 'components/FourOhFourPage'; +import FourOhFourPage from 'containers/FourOhFourPage'; const App = () => { return ( diff --git a/react/containers/FourOhFourPage/index.jsx b/react/containers/FourOhFourPage/index.jsx new file mode 100644 index 00000000..b16aa2a5 --- /dev/null +++ b/react/containers/FourOhFourPage/index.jsx @@ -0,0 +1,11 @@ +import { connect } from 'react-redux'; +import View from './view'; + +const mapStateToProps = ({ site: { host, title } }) => { + return { + host, + title, + }; +}; + +export default connect(mapStateToProps, null)(View); diff --git a/react/components/FourOhFourPage/index.jsx b/react/containers/FourOhFourPage/view.jsx similarity index 80% rename from react/components/FourOhFourPage/index.jsx rename to react/containers/FourOhFourPage/view.jsx index 0a9caec3..ad1d735b 100644 --- a/react/components/FourOhFourPage/index.jsx +++ b/react/containers/FourOhFourPage/view.jsx @@ -1,10 +1,10 @@ import React from 'react'; -import NavBar from 'containers/NavBar'; +import NavBar from 'containers/NavBar/index'; import Helmet from 'react-helmet'; -const { details: { title, host } } = require('../../../config/siteConfig.js'); class FourOhForPage extends React.Component { render () { + const {title, host} = this.props; return (
diff --git a/react/reducers/site.js b/react/reducers/site.js index 91524abf..08d1f6bf 100644 --- a/react/reducers/site.js +++ b/react/reducers/site.js @@ -1,7 +1,13 @@ -const { details: { host }, assetDefaults: { thumbnail: defaultThumbnail } } = require('../../config/siteConfig.js'); +const siteConfig = require('../../config/siteConfig.js'); + +const { + details: { title, host }, + assetDefaults: { thumbnail: defaultThumbnail }, +} = siteConfig; const initialState = { host, + title, defaults: { defaultThumbnail, },