{user.username}
{profile && this.profile = ref} value={profile} />}
+
(WrappedComponent) => {
- console.log(config, WrappedComponent)
+export default (WrappedComponent) => {
class withCopyToClipboard extends React.Component {
-
componentDidMount() {
- const node = ReactDOM.findDOMNode(WrappedComponent);
- const clipboard = new Clipboard(node);
+ const clipboard = new Clipboard(ReactDOM.findDOMNode(this));
clipboard.on('success', (e) => {
- this.props.onCopy();
+ if (this.props.onCopy) {
+ this.props.onCopy();
+ }
e.clearSelection();
});
}
render() {
- const {target = '', text = ''} = config;
+ const {target = '', text = '', className = '', ...rest} = this.props;
return ;
}
}
diff --git a/client/coral-ui/components/Button.js b/client/coral-ui/components/Button.js
index 6d3dc94d2..cbfb6ad61 100644
--- a/client/coral-ui/components/Button.js
+++ b/client/coral-ui/components/Button.js
@@ -2,20 +2,23 @@ import React from 'react';
import styles from './Button.css';
import Icon from './Icon';
-const Button = ({cStyle = 'local', children, className, raised = false, full = false, icon = '', ...props}) => (
-
-);
-
-export default Button;
+export default class Button extends React.Component {
+ render() {
+ const {cStyle = 'local', children, className, raised = false, full = false, icon = '', ...props} = this.props;
+ return (
+
+ );
+ }
+}