-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathchild-button.js
36 lines (31 loc) · 896 Bytes
/
child-button.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
var React = require('react');
var classnames = require('classnames');
var ChildButton = React.createClass({
handleOnClick: function handleOnClick(e) {
if(this.props.disabled === true)
{
return;
}
if(this.props.onClick){
this.props.onClick(e);
}
},
render: function(){
var iconClass = classnames('mfb-component__child-icon', this.props.icon);
var className = classnames('mfb-component__button--child',
this.props.className,
{"mfb-component__button--disabled": this.props.disabled});
return (
<li>
<a href={this.props.href}
data-mfb-label={this.props.label}
onClick={this.handleOnClick}
className={className}>
<i className={iconClass}></i>
</a>
</li>
);
}
});
module.exports = ChildButton;