/*
- *
+ *
* Copyright 2016 RIFT.IO Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
label: null,
title: null,
src: null,
+ disabled: false,
onClick: () => {}
};
},
const title = this.props.title;
const draggable = this.props.draggable;
const className = ClassNames(this.props.className, 'Button');
+ let style = {
+ }
+ if(this.props.disabled) {
+ style.pointerEvents = 'none';
+ style.cursor = 'not-allowed';
+ style.opacity = 0.25;
+ }
return (
- <div className={className} onClick={this.props.onClick} title={title} draggable={draggable} onDragStart={this.props.onDragStart}>
- <img src={src} />
- <span>{label}</span>
+ <div className={className} onClick={this.props.onClick} title={title} draggable={draggable} onDragStart={this.props.onDragStart} style={style}>
+ { src ? <img src={src} /> : null }
+ {label}
</div>
);
}