about summary refs log tree commit diff
path: root/app/assets/javascripts/components/components/button.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/components/components/button.jsx')
-rw-r--r--app/assets/javascripts/components/components/button.jsx47
1 files changed, 24 insertions, 23 deletions
diff --git a/app/assets/javascripts/components/components/button.jsx b/app/assets/javascripts/components/components/button.jsx
index 6c3da10fe..8d0e49aee 100644
--- a/app/assets/javascripts/components/components/button.jsx
+++ b/app/assets/javascripts/components/components/button.jsx
@@ -1,31 +1,17 @@
-import PureRenderMixin from 'react-addons-pure-render-mixin';
-
-const Button = React.createClass({
-
-  propTypes: {
-    text: React.PropTypes.node,
-    onClick: React.PropTypes.func,
-    disabled: React.PropTypes.bool,
-    block: React.PropTypes.bool,
-    secondary: React.PropTypes.bool,
-    size: React.PropTypes.number,
-    style: React.PropTypes.object,
-    children: React.PropTypes.node
-  },
-
-  getDefaultProps () {
-    return {
-      size: 36
-    };
-  },
+import PropTypes from 'prop-types';
+
+class Button extends React.PureComponent {
 
-  mixins: [PureRenderMixin],
+  constructor (props, context) {
+    super(props, context);
+    this.handleClick = this.handleClick.bind(this);
+  }
 
   handleClick (e) {
     if (!this.props.disabled) {
       this.props.onClick();
     }
-  },
+  }
 
   render () {
     const style = {
@@ -57,6 +43,21 @@ const Button = React.createClass({
     );
   }
 
-});
+}
+
+Button.propTypes = {
+  text: PropTypes.node,
+  onClick: PropTypes.func,
+  disabled: PropTypes.bool,
+  block: PropTypes.bool,
+  secondary: PropTypes.bool,
+  size: PropTypes.number,
+  style: PropTypes.object,
+  children: PropTypes.node
+};
+
+Button.defaultProps = {
+  size: 36
+};
 
 export default Button;