Sha256: 5d0ac360600933260f2bbc22d7b5995c71cdb94477b96b35c7096eba93767533

Contents?: true

Size: 979 Bytes

Versions: 5

Compression:

Stored size: 979 Bytes

Contents

import React from 'react';

import PropTypes from 'prop-types';

import { action } from 'mobx';
import { observer } from 'mobx-react';
import Icon from 'hippo/components/icon';

import Anchor from 'grommet/components/Anchor';

@observer
export default class MenuOption extends React.Component {

    static propTypes = {
        screen: PropTypes.shape({
            title:   PropTypes.string.isRequired,
            icon:    PropTypes.string.isRequired,
            display: PropTypes.func.isRequired,
        }).isRequired,
    }

    static contextTypes = {
        viewport: PropTypes.object,
    }

    @action.bound
    activateScreen() {
        this.props.screen.display();
    }

    render() {
        const { screen } = this.props;
        return (
            <Anchor path={`/${screen.id}/`} onClick={this.activateScreen}>
                {screen.title}
                <Icon type={screen.icon} />
            </Anchor>
        );
    }
}
//<div>{screen.title}</div>

Version data entries

5 entries across 5 versions & 1 rubygems

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