2017-05-19 14:42:43 -06:00
|
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
2017-06-02 07:19:39 +09:00
|
|
|
|
import Button from 'react-bootstrap/lib/Button';
|
2017-03-23 16:27:59 +09:00
|
|
|
|
import { registerComponent } from 'meteor/vulcan:core';
|
2017-03-15 10:36:02 +08:00
|
|
|
|
|
2017-05-19 14:42:43 -06:00
|
|
|
|
export class AccountsButton extends PureComponent {
|
2017-03-15 10:36:02 +08:00
|
|
|
|
render () {
|
2017-03-23 12:50:49 +09:00
|
|
|
|
|
2017-03-15 10:36:02 +08:00
|
|
|
|
const {
|
|
|
|
|
label,
|
|
|
|
|
href = null,
|
|
|
|
|
type,
|
|
|
|
|
disabled = false,
|
|
|
|
|
className,
|
|
|
|
|
onClick
|
|
|
|
|
} = this.props;
|
2017-03-23 12:50:49 +09:00
|
|
|
|
|
|
|
|
|
return type === 'link' ?
|
|
|
|
|
<a href="#" className={ className } onClick={ onClick } style={{marginRight: '10px'}}>{ label }</a> :
|
|
|
|
|
<Button
|
|
|
|
|
style={{marginRight: '10px'}}
|
|
|
|
|
bsStyle="primary"
|
|
|
|
|
className={ className }
|
|
|
|
|
type={ type }
|
|
|
|
|
disabled={ disabled }
|
|
|
|
|
onClick={ onClick }>
|
|
|
|
|
{ label }
|
|
|
|
|
</Button>;
|
2017-03-15 10:36:02 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-23 12:50:49 +09:00
|
|
|
|
AccountsButton.propTypes = {
|
2017-05-19 14:42:43 -06:00
|
|
|
|
onClick: PropTypes.func
|
2017-03-15 10:36:02 +08:00
|
|
|
|
};
|
|
|
|
|
|
2017-03-23 12:50:49 +09:00
|
|
|
|
registerComponent('AccountsButton', AccountsButton);
|