mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 14:10:04 +02:00
refactoring - created DumbTab for non routable tab
This commit is contained in:
parent
dcc410bc17
commit
ea4b959c89
@ -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 = ({
|
const OrgNavigation = ({
|
||||||
orgs = []
|
orgs = []
|
||||||
}) => {
|
}) => {
|
||||||
@ -116,27 +130,11 @@ const OrgNavigation = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const manageTabs = () => (
|
const manageTabs = () => (
|
||||||
<NavLi activeClassName='active' to='#'>{({
|
<DumbTab>Manage Tabs ({orgs.length})</DumbTab>
|
||||||
isActive
|
|
||||||
}) =>
|
|
||||||
<NavigationLinkContainer className={isActive ? 'active' : ''}>
|
|
||||||
<OrgName>
|
|
||||||
Manage Tabs ({orgs.length})
|
|
||||||
</OrgName>
|
|
||||||
</NavigationLinkContainer>
|
|
||||||
}</NavLi>
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const addOrgTab = () => (
|
const addOrgTab = () => (
|
||||||
<NavLi activeClassName='active' to='#'>{({
|
<DumbTab>+ Add organisation</DumbTab>
|
||||||
isActive
|
|
||||||
}) =>
|
|
||||||
<NavigationLinkContainer className={isActive ? 'active' : ''}>
|
|
||||||
<OrgName>
|
|
||||||
+ Add organisation
|
|
||||||
</OrgName>
|
|
||||||
</NavigationLinkContainer>
|
|
||||||
}</NavLi>
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -157,6 +155,10 @@ OrgNavigation.propTypes = {
|
|||||||
orgs: React.PropTypes.arrayOf(PropTypes.org)
|
orgs: React.PropTypes.arrayOf(PropTypes.org)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DumbTab.propTypes = {
|
||||||
|
children: React.PropTypes.node
|
||||||
|
};
|
||||||
|
|
||||||
const mapStateToProps = (state) => ({
|
const mapStateToProps = (state) => ({
|
||||||
orgs: orgsSelector(state)
|
orgs: orgsSelector(state)
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user