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

34 lines
No EOL
816 B
JavaScript
Executable file
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 { Button } from 'react-bootstrap';
import { registerComponent } from 'meteor/vulcan:core';
export class AccountsButton extends React.Component {
render () {
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>;
}
}
AccountsButton.propTypes = {
onClick: React.PropTypes.func
};
registerComponent('AccountsButton', AccountsButton);