From f1b677dbd16a5dc85331b148a2e4f5980048ab67 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Wed, 3 Feb 2016 12:38:34 +0100 Subject: [PATCH] Use the activeRoute prop to generate route classnames on whitelabels --- js/components/whitelabel/prize/portfolioreview/pr_app.js | 5 +---- js/components/whitelabel/prize/simple_prize/prize_app.js | 5 +---- js/components/whitelabel/wallet/wallet_app.js | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/js/components/whitelabel/prize/portfolioreview/pr_app.js b/js/components/whitelabel/prize/portfolioreview/pr_app.js index c738c0bd..73df2766 100644 --- a/js/components/whitelabel/prize/portfolioreview/pr_app.js +++ b/js/components/whitelabel/prize/portfolioreview/pr_app.js @@ -61,10 +61,7 @@ let PRApp = React.createClass({ const { activeRoute, children, history, routes } = this.props; const { currentUser } = this.state; const subdomain = getSubdomain(); - - // The second element of routes is always the active component object, where we can - // extract the path. - const path = routes[1] ? routes[1].path : null; + const path = activeRoute && activeRoute.path; let style = {}; let header; diff --git a/js/components/whitelabel/prize/simple_prize/prize_app.js b/js/components/whitelabel/prize/simple_prize/prize_app.js index e3f1e290..97ccb53c 100644 --- a/js/components/whitelabel/prize/simple_prize/prize_app.js +++ b/js/components/whitelabel/prize/simple_prize/prize_app.js @@ -23,10 +23,7 @@ let PrizeApp = React.createClass({ render() { const { activeRoute, children, history, routes } = this.props; const subdomain = getSubdomain(); - - // The second element of routes is always the active component object, where we can - // extract the path. - const path = routes[1] ? routes[1].path : null; + const path = activeRoute && activeRoute.path; let header = null; // if the path of the current activeRoute is not defined, then this is the IndexRoute diff --git a/js/components/whitelabel/wallet/wallet_app.js b/js/components/whitelabel/wallet/wallet_app.js index 10ebd2b3..ec709ffc 100644 --- a/js/components/whitelabel/wallet/wallet_app.js +++ b/js/components/whitelabel/wallet/wallet_app.js @@ -21,10 +21,7 @@ let WalletApp = React.createClass({ render() { const { activeRoute, children, history, routes } = this.props; const subdomain = getSubdomain(); - - // The second element of routes is always the active component object, where we can - // extract the path. - const path = routes[1] ? routes[1].path : null; + const path = activeRoute && activeRoute.path; let header = null; // if the path of the current activeRoute is not defined, then this is the IndexRoute