mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Add StaticPage component
This commit is contained in:
parent
97b5f0563f
commit
8776cfe785
4 changed files with 52 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
15
docs/static-pages.md
Normal file
15
docs/static-pages.md
Normal file
|
|
@ -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
|
||||
35
src/containers/StaticPage/StaticPage.js
Normal file
35
src/containers/StaticPage/StaticPage.js
Normal file
|
|
@ -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 (
|
||||
<Page {...pageProps}>
|
||||
{children}
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
|
||||
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;
|
||||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue