From dcc410bc17ab3843814da29bbcd1eca8b05b76b8 Mon Sep 17 00:00:00 2001 From: Alex Windett Date: Wed, 1 Mar 2017 12:01:14 +0000 Subject: [PATCH 1/2] adding managable tabs for organistaion nav --- frontend/src/components/navigation/org.js | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/frontend/src/components/navigation/org.js b/frontend/src/components/navigation/org.js index 81611cdd..8da19eb8 100644 --- a/frontend/src/components/navigation/org.js +++ b/frontend/src/components/navigation/org.js @@ -53,6 +53,7 @@ const OrgName = styled.span` const NavLi = styled(NavLink)` display: inline-block; text-decoration: none; + font-size: 16px; `; const StyledTabs = styled(Tabs)` @@ -73,6 +74,13 @@ const StyledContainer = styled(Container)` `} `; +const ManageTab = styled(Tab)` + + ${breakpoints.medium` + float: right; + `} +`; + const OrgNavigation = ({ orgs = [] }) => { @@ -107,11 +115,38 @@ const OrgNavigation = ({ ); }); + const manageTabs = () => ( + {({ + isActive + }) => + + + Manage Tabs ({orgs.length}) + + + } + ); + + const addOrgTab = () => ( + {({ + isActive + }) => + + + +   Add organisation + + + } + ); + return ( {navLinks} + + + From ea4b959c89628f5926eadf769a9cd5d9cb1fb513 Mon Sep 17 00:00:00 2001 From: Alex Windett Date: Wed, 1 Mar 2017 12:07:52 +0000 Subject: [PATCH 2/2] 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) });