1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

Small stylistic changes to Header and NavRoutes

This commit is contained in:
Brett Sun 2016-01-21 15:11:19 +01:00
parent 41c9a10c84
commit 9b1e6cc8a1
3 changed files with 33 additions and 26 deletions

View File

@ -93,13 +93,13 @@ let Header = React.createClass({
<img className="img-brand" src={whitelabel.logo} alt="Whitelabel brand"/> <img className="img-brand" src={whitelabel.logo} alt="Whitelabel brand"/>
</Link> </Link>
); );
} } else {
return ( return (
<span> <span>
<Link className="icon-ascribe-logo" to="/collection"/> <Link className="icon-ascribe-logo" to="/collection"/>
</span> </span>
); );
}
}, },
getPoweredBy() { getPoweredBy() {
@ -159,6 +159,7 @@ let Header = React.createClass({
let account; let account;
let signup; let signup;
let navRoutesLinks; let navRoutesLinks;
if (this.state.currentUser.username) { if (this.state.currentUser.username) {
account = ( account = (
<DropdownButton <DropdownButton
@ -195,9 +196,15 @@ let Header = React.createClass({
</LinkContainer> </LinkContainer>
</DropdownButton> </DropdownButton>
); );
navRoutesLinks = <NavRoutesLinks routes={this.props.routes} userAcl={this.state.currentUser.acl} navbar right/>;
} navRoutesLinks = (
else { <NavRoutesLinks
navbar
right
routes={this.props.routes}
userAcl={this.state.currentUser.acl} />
);
} else {
account = ( account = (
<LinkContainer <LinkContainer
to="/login"> to="/login">

View File

@ -33,15 +33,15 @@ let NavRoutesLinks = React.createClass({
return; return;
} }
let links = node.childRoutes.map((child, j) => { const links = node.childRoutes.map((child, j) => {
const { aclName, headerTitle, path, childRoutes } = child;
let childrenFn = null; let childrenFn = null;
let { aclName, headerTitle, path, childRoutes } = child;
// If the node has children that could be rendered, then we want // If the node has children that could be rendered, then we want
// to execute this function again with the child as the root // to execute this function again with the child as the root
// //
// Otherwise we'll just pass childrenFn as false // Otherwise we'll just pass childrenFn as false
if(child.childRoutes && child.childRoutes.length > 0) { if (child.childRoutes && child.childRoutes.length) {
childrenFn = this.extractLinksFromRoutes(child, userAcl, i++); childrenFn = this.extractLinksFromRoutes(child, userAcl, i++);
} }
@ -84,7 +84,7 @@ let NavRoutesLinks = React.createClass({
}, },
render() { render() {
let {routes, userAcl} = this.props; const {routes, userAcl} = this.props;
return ( return (
<Nav {...this.props}> <Nav {...this.props}>

View File

@ -23,7 +23,7 @@ let NavRoutesLinksLink = React.createClass({
}, },
render() { render() {
let { children, headerTitle, depth, routePath } = this.props; const { children, headerTitle, depth, routePath } = this.props;
// if the route has children, we're returning a DropdownButton that will get filled // if the route has children, we're returning a DropdownButton that will get filled
// with MenuItems // with MenuItems