2016-03-28 22:34:50 +02:00
|
|
|
|
import React from 'react';
|
|
|
|
|
import { Accounts } from 'meteor/accounts-base';
|
|
|
|
|
|
|
|
|
|
export class Button extends React.Component {
|
|
|
|
|
render () {
|
2016-03-29 06:02:58 +02:00
|
|
|
|
const { label, type, disabled = false, onClick, className } = this.props;
|
2016-03-28 22:34:50 +02:00
|
|
|
|
return type == 'link' ? (
|
2016-03-29 06:02:58 +02:00
|
|
|
|
<a className={ className } onClick={ onClick }>{ label }</a>
|
2016-03-28 22:34:50 +02:00
|
|
|
|
) : (
|
2016-03-29 06:02:58 +02:00
|
|
|
|
<button className={ className } type={type} disabled={ disabled }
|
2016-03-28 22:34:50 +02:00
|
|
|
|
onClick={ onClick }>{ label }</button>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Button.propTypes = {
|
|
|
|
|
onClick: React.PropTypes.func
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Accounts.ui.Button = Button;
|