accounts-ui/imports/ui/components/Button.jsx

20 lines
541 B
React
Raw Normal View History

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 () {
const { label, type, disabled = false, onClick, className } = this.props;
2016-03-28 22:34:50 +02:00
return type == 'link' ? (
<a className={ className } onClick={ onClick }>{ label }</a>
2016-03-28 22:34:50 +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;