diff --git a/public/components/App.jsx b/public/components/App.jsx index 24ea1b3..cc21bea 100644 --- a/public/components/App.jsx +++ b/public/components/App.jsx @@ -35,13 +35,11 @@ import Favicon from './Favicon'; //Routes Definitions const AppRoutes = (props) => { return ( - - - import('@pages/home/HomePage') } /> - import ('@pages/contact/ContactPage') } /> - import('@pages/legal/privacy/PrivacyPolicyPage') } /> - - + + import('@pages/home/HomePage') } /> + import ('@pages/contact/ContactPage') } /> + import('@pages/legal/privacy/PrivacyPolicyPage') } /> + ); }; @@ -61,12 +59,15 @@ class App extends React.Component { } render() { - let { className } = this.props; + let newProps= {...this.props}; + let { className, modal } = newProps; + ["dispatch"].forEach(e => delete newProps[e]); //Generate base clazzes let clazz = "c-app"; //Append any other clazzes there may be. + if(modal.open) clazz += ' is-modal-open'; if(className) clazz += ` ${className}`; //For testing you can switch the router type @@ -75,7 +76,8 @@ class App extends React.Component { return ( -
+
+ { modal.modal }
@@ -88,4 +90,6 @@ class App extends React.Component { } } -export default App; +export default connect(state => { + return { modal: state.modal }; +})(App); diff --git a/public/objects/modal/Modal.jsx b/public/objects/modal/Modal.jsx index 17f04fa..4d5f2ea 100644 --- a/public/objects/modal/Modal.jsx +++ b/public/objects/modal/Modal.jsx @@ -54,15 +54,15 @@ class Modal extends React.Component { } render() { - let { buttons, closeModal, close, title, children, large, modal } = this.props; + let newProps = {...this.props}; + let { buttons, closeModal, close, title, children, large, modal } = newProps; + ["onExited"].forEach(e => delete newProps[e]); //Add necessary buttons buttons = buttons || []; if(!Array.isArray(buttons)) buttons = [ buttons ]; - if(close) { - buttons.push(); - } + if(close) buttons = [...buttons,