From ea4b959c89628f5926eadf769a9cd5d9cb1fb513 Mon Sep 17 00:00:00 2001 From: Alex Windett Date: Wed, 1 Mar 2017 12:07:52 +0000 Subject: [PATCH] refactoring - created DumbTab for non routable tab --- frontend/src/components/navigation/org.js | 38 ++++++++++++----------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/frontend/src/components/navigation/org.js b/frontend/src/components/navigation/org.js index 8da19eb8..1ec9c7c0 100644 --- a/frontend/src/components/navigation/org.js +++ b/frontend/src/components/navigation/org.js @@ -81,6 +81,20 @@ const ManageTab = styled(Tab)` `} `; +const DumbTab = ({ + children +}) => ( + {({ + isActive + }) => + + + {children} + + + } +); + const OrgNavigation = ({ orgs = [] }) => { @@ -116,27 +130,11 @@ const OrgNavigation = ({ }); const manageTabs = () => ( - {({ - isActive - }) => - - - Manage Tabs ({orgs.length}) - - - } + Manage Tabs ({orgs.length}) ); const addOrgTab = () => ( - {({ - isActive - }) => - - - +   Add organisation - - - } + +   Add organisation ); return ( @@ -157,6 +155,10 @@ OrgNavigation.propTypes = { orgs: React.PropTypes.arrayOf(PropTypes.org) }; +DumbTab.propTypes = { + children: React.PropTypes.node +}; + const mapStateToProps = (state) => ({ orgs: orgsSelector(state) });