export default React.createClass({
renderLogo() {
let url = this.props.logoUrl || `${window.baseUrl}/images/logo.svg`,
- width = this.props.logoWidth || null,
- height = this.props.logoWidth ? 30 : null,
+ width = this.props.logoWidth || 100,
+ height = 30,
title = window.t('layout.sonar.slogan');
return <img src={url} width={width} height={height} alt={title} title={title}/>;
},
import $ from 'jquery';
+import _ from 'underscore';
import React from 'react';
import GlobalNavBranding from './global-nav-branding';
import GlobalNavMenu from './global-nav-menu';
export default React.createClass({
getInitialState() {
- return this.props;
+ return _.extend({}, this.props, { ready: false });
},
componentDidMount() {
loadGlobalNavDetails() {
$.get(`${window.baseUrl}/api/navigation/global`).done(r => {
- this.setState(r);
+ this.setState(_.extend({ ready: true }, r));
});
},
},
render() {
+ if (!this.state.ready) {
+ return null;
+ }
+
return (
<div className="container">
<GlobalNavBranding {...this.state}/>