From 8776cfe78585776c7a26269b52309a8d09e57bfe Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Tue, 17 Oct 2017 15:49:24 +0300 Subject: [PATCH] Add StaticPage component --- docs/README.md | 1 + docs/static-pages.md | 15 +++++++++++ src/containers/StaticPage/StaticPage.js | 35 +++++++++++++++++++++++++ src/containers/index.js | 1 + 4 files changed, 52 insertions(+) create mode 100644 docs/static-pages.md create mode 100644 src/containers/StaticPage/StaticPage.js diff --git a/docs/README.md b/docs/README.md index c5f1ccc3..0476533f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,3 +13,4 @@ Documentation for specific topics can be found in the following files: - [Testing](testing.md) - [Error logging with Sentry](sentry.md) - [CI](ci.md) + - [Static pages](static-pages.md) diff --git a/docs/static-pages.md b/docs/static-pages.md new file mode 100644 index 00000000..9e62341f --- /dev/null +++ b/docs/static-pages.md @@ -0,0 +1,15 @@ +# Static pages + +TODO + +## Creating the component + +TODO + +## Adding the component to the index of components + +TODO + +## Adding a route for the component + +TODO diff --git a/src/containers/StaticPage/StaticPage.js b/src/containers/StaticPage/StaticPage.js new file mode 100644 index 00000000..3561e2fa --- /dev/null +++ b/src/containers/StaticPage/StaticPage.js @@ -0,0 +1,35 @@ +import React from 'react'; +import { node } from 'prop-types'; +import { connect } from 'react-redux'; +import { isScrollingDisabled } from '../../ducks/UI.duck'; +import { Page } from '../../components'; + +const StaticPageComponent = props => { + const { children, ...pageProps } = props; + return ( + + {children} + + ); +}; + +StaticPageComponent.defaultProps = { + children: null, +}; + +StaticPageComponent.propTypes = { + children: node, +}; + +const mapStateToProps = state => { + const { authInfoError, logoutError } = state.Auth; + return { + authInfoError, + logoutError, + scrollingDisabled: isScrollingDisabled(state), + }; +}; + +const StaticPage = connect(mapStateToProps)(StaticPageComponent); + +export default StaticPage; diff --git a/src/containers/index.js b/src/containers/index.js index b06411e9..fc02bac8 100644 --- a/src/containers/index.js +++ b/src/containers/index.js @@ -37,6 +37,7 @@ export { default as SalePage } from './SalePage/SalePage'; export { default as SearchPage } from './SearchPage/SearchPage'; export { default as SecurityPage } from './SecurityPage/SecurityPage'; export { default as SignupForm } from './SignupForm/SignupForm'; +export { default as StaticPage } from './StaticPage/StaticPage'; export { default as StripePaymentForm } from './StripePaymentForm/StripePaymentForm'; export { default as StyleguidePage } from './StyleguidePage/StyleguidePage'; export { default as TopbarContainer } from './TopbarContainer/TopbarContainer';