1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-01 07:30:07 +02:00

refactoring - created DumbTab for non routable tab

This commit is contained in:
Alex Windett 2017-03-01 12:07:52 +00:00
parent dcc410bc17
commit ea4b959c89

View File

@ -81,6 +81,20 @@ const ManageTab = styled(Tab)`
`}
`;
const DumbTab = ({
children
}) => (
<NavLi activeClassName='active' to='#'>{({
isActive
}) =>
<NavigationLinkContainer className={isActive ? 'active' : ''}>
<OrgName>
{children}
</OrgName>
</NavigationLinkContainer>
}</NavLi>
);
const OrgNavigation = ({
orgs = []
}) => {
@ -116,27 +130,11 @@ const OrgNavigation = ({
});
const manageTabs = () => (
<NavLi activeClassName='active' to='#'>{({
isActive
}) =>
<NavigationLinkContainer className={isActive ? 'active' : ''}>
<OrgName>
Manage Tabs ({orgs.length})
</OrgName>
</NavigationLinkContainer>
}</NavLi>
<DumbTab>Manage Tabs ({orgs.length})</DumbTab>
);
const addOrgTab = () => (
<NavLi activeClassName='active' to='#'>{({
isActive
}) =>
<NavigationLinkContainer className={isActive ? 'active' : ''}>
<OrgName>
+ &nbsp; Add organisation
</OrgName>
</NavigationLinkContainer>
}</NavLi>
<DumbTab>+ &nbsp; Add organisation</DumbTab>
);
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)
});