From 1c94ecc1777c971bf80a92248e2c57e66bfdbd0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 4 Mar 2016 15:53:55 +0100 Subject: [PATCH] Add footer property to Route --- js/components/ascribe_app.js | 3 +- js/components/footer.js | 9 +- .../prize/portfolioreview/pr_app.js | 3 +- .../whitelabel/prize/prize_routes.js | 72 +++---- .../prize/simple_prize/prize_app.js | 3 +- js/components/whitelabel/wallet/wallet_app.js | 3 +- .../whitelabel/wallet/wallet_routes.js | 199 ++++++------------ js/routes.js | 38 ++-- 8 files changed, 128 insertions(+), 202 deletions(-) diff --git a/js/components/ascribe_app.js b/js/components/ascribe_app.js index 87ab1daf..4848c01a 100644 --- a/js/components/ascribe_app.js +++ b/js/components/ascribe_app.js @@ -21,6 +21,7 @@ let AscribeApp = React.createClass({ render() { const { activeRoute, children, currentUser, routes, whitelabel } = this.props; + const Footer = activeRoute && activeRoute.footer; return (
@@ -34,7 +35,7 @@ let AscribeApp = React.createClass({ {/* Routes are injected here */} {children} -
+ {Footer ?
: null}
); } diff --git a/js/components/footer.js b/js/components/footer.js index 3010da4d..ced01fb5 100644 --- a/js/components/footer.js +++ b/js/components/footer.js @@ -4,13 +4,10 @@ import React from 'react'; import { getLangText } from '../utils/lang_utils'; -let Footer = React.createClass({ - propTypes: { - activeRoute: React.PropTypes.object.isRequired - }, +const Footer = React.createClass({ render() { - return !this.props.activeRoute.hideFooter ? ( + return (


@@ -28,7 +25,7 @@ let Footer = React.createClass({

- ) : null; + ); } }); diff --git a/js/components/whitelabel/prize/portfolioreview/pr_app.js b/js/components/whitelabel/prize/portfolioreview/pr_app.js index d8b9f982..1639e750 100644 --- a/js/components/whitelabel/prize/portfolioreview/pr_app.js +++ b/js/components/whitelabel/prize/portfolioreview/pr_app.js @@ -35,6 +35,7 @@ let PRApp = React.createClass({ const { activeRoute, children, currentUser, history, routes, whitelabel } = this.props; const subdomain = getSubdomain(); const path = activeRoute && activeRoute.path; + const Footer = activeRoute && activeRoute.footer; let style = {}; let header; @@ -64,7 +65,7 @@ let PRApp = React.createClass({ {/* Routes are injected here */} {children} -