diff --git a/js/components/acl_proxy.js b/js/components/acl_proxy.js index be0d8466..10a7516e 100644 --- a/js/components/acl_proxy.js +++ b/js/components/acl_proxy.js @@ -20,21 +20,28 @@ let AclProxy = React.createClass({ show: React.PropTypes.bool }, - render() { - if(this.props.show) { + getChildren() { + if (this.props.children.length && this.props.children.length > 1){ + /* + This might ruin styles for header items in the navbar etc + */ return ( {this.props.children} ); + } + /* can only do this when there is only 1 child, but will preserve styles */ + return this.props.children; + }, + + render() { + if(this.props.show) { + return this.getChildren(); } else { if(this.props.aclObject) { if(this.props.aclObject[this.props.aclName]) { - return ( - - {this.props.children} - - ); + return this.getChildren(); } else { /* if(typeof this.props.aclObject[this.props.aclName] === 'undefined') { console.warn('The aclName you\'re filtering for was not present (or undefined) in the aclObject.'); diff --git a/js/components/nav_routes_links.js b/js/components/nav_routes_links.js index 68fddc55..d3342cb8 100644 --- a/js/components/nav_routes_links.js +++ b/js/components/nav_routes_links.js @@ -48,7 +48,6 @@ let NavRoutesLinks = React.createClass({ // We validate if the user has set the title correctly, // otherwise we're not going to render his route if(headerTitle && typeof headerTitle === 'string') { - // if there is an aclName present on the route definition, // we evaluate it against the user's acl if(aclName && typeof aclName !== 'undefined') { diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js index f333e6bb..25fc1d80 100644 --- a/js/components/whitelabel/wallet/wallet_routes.js +++ b/js/components/whitelabel/wallet/wallet_routes.js @@ -72,7 +72,7 @@ let ROUTES = { - +