Home Reference Source

application/components/common/rich-editor2/common/toolbar-button.js

import React, { Component } from 'react';

class ToolbarButton extends Component {

    handleOnClick(e) {
        if (this.props.disabled && this.props.disabled === true) {
            return;
        }
        this.props.onClick(e);
    }

    getLabel() {
        return this.props.children;
    }

    render() {

        return (
            <div className='__rich-editor2-toolbar-button' onClick={this.handleOnClick.bind(this)} title={this.props.title ? this.props.title : ''}>
                {this.getLabel.call(this)}
            </div>
        );
    }
}

export default ToolbarButton;