Vulcan/packages/vulcan-accounts/imports/ui/components/Button.jsx

34 lines
816 B
React
Raw Normal View History

2017-03-15 10:36:02 +08:00
import React from 'react';
import { Button } from 'react-bootstrap';
2017-03-23 16:27:59 +09:00
import { registerComponent } from 'meteor/vulcan:core';
2017-03-15 10:36:02 +08:00
export class AccountsButton extends React.Component {
2017-03-15 10:36:02 +08:00
render () {
2017-03-15 10:36:02 +08:00
const {
label,
href = null,
type,
disabled = false,
className,
onClick
} = this.props;
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
}
}
AccountsButton.propTypes = {
2017-03-15 10:36:02 +08:00
onClick: React.PropTypes.func
};
registerComponent('AccountsButton', AccountsButton);