4 * Copyright 2016 RIFT.IO Inc
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 * Created by onvelocity on 12/1/15.
24 import guid
from '../libraries/guid'
25 import React
from 'react'
26 import ClassNames
from 'classnames'
27 import PureRenderMixin
from 'react-addons-pure-render-mixin'
28 import SelectionManager
from '../libraries/SelectionManager'
30 import '../styles/Button.scss'
32 const Button
= React
.createClass({
33 mixins
: [PureRenderMixin
],
34 getInitialState: function () {
37 getDefaultProps: function () {
46 componentWillMount: function () {
48 componentDidMount: function () {
50 componentDidUpdate: function () {
52 componentWillUnmount: function () {
55 const src
= this.props
.src
;
56 const label
= this.props
.label
;
57 const title
= this.props
.title
;
58 const draggable
= this.props
.draggable
;
59 const className
= ClassNames(this.props
.className
, 'Button');
61 <div className
={className
} onClick
={this.props
.onClick
} title
={title
} draggable
={draggable
} onDragStart
={this.props
.onDragStart
}>
62 { src
? <img src
={src
} /> : null }
69 export default Button
;