Sha256: 169b57f828df6f2c0465af63ea2d0b4d9b9e97bf15c0555fffddeb974220031b

Contents?: true

Size: 1.31 KB

Versions: 5

Compression:

Stored size: 1.31 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { get, bindAll } from 'lodash';

import Config from '../config';
import Extensions from '../extensions';

function Logo() {
    const url = get(Config, 'system_settings.logo.thumbnail_url');
    const title = get(Extensions, 'controlling.title');
    return url ?
        <img alt={`${title} Logo`} src={`//${Config.api_host}${url}`} /> : <span>{title}</span>;
}

export default class Navbar extends React.Component {

    static contextTypes = {
        uistate: PropTypes.object.isRequired,
    }

    constructor(props) {
        super(props);
        bindAll(this, 'switchMenu');
    }

    switchMenu(ev) {
        if (ev) { ev.preventDefault(); }
        this.context.uistate.nextSidebarState();
    }

    render() {
        return (
            <div className="header-top">
                <div className="navbar-header">
                    <div className="navbar-brand logo"><Logo /></div>
                    <button className="screens-menu-toggle" onClick={this.switchMenu} type="button">
                        <span className="sr-only">
                                Toggle navbar
                            </span>
                        <i className="icon" />
                    </button>
                </div>
            </div>
        );
    }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hippo-fw-0.9.5 client/hippo/workspace/navbar.jsx
hippo-fw-0.9.4 client/hippo/workspace/navbar.jsx
hippo-fw-0.9.3 client/hippo/workspace/navbar.jsx
hippo-fw-0.9.2 client/hippo/workspace/navbar.jsx
hippo-fw-0.9.1 client/hippo/workspace/navbar.jsx