accounts-ui/imports/ui/components/Button.jsx
2016-04-02 22:49:12 +02:00

27 lines
661 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import { Accounts } from 'meteor/accounts-base';
export class Button extends React.Component {
render () {
const {
label,
href = null,
type,
disabled = false,
className,
onClick
} = this.props;
if (type == 'link') {
return <a href={ href } className={ className } onClick={ onClick }>{ label }</a>;
}
return <button className={ className }
type={ type } 
disabled={ disabled }
onClick={ onClick }>{ label }</button>;
}
}
Button.propTypes = {
onClick: React.PropTypes.func
};
Accounts.ui.Button = Button;