mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-04 23:14:56 +01:00
91df7122f2
* 15089: add button link component
46 lines
1.0 KiB
JavaScript
46 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import classnames from 'classnames';
|
|
|
|
import { ButtonBase } from '../button-base';
|
|
import { BUTTON_LINK_SIZES } from './button-link.constants';
|
|
|
|
export const ButtonLink = ({
|
|
className,
|
|
danger,
|
|
size = BUTTON_LINK_SIZES.MD,
|
|
...props
|
|
}) => {
|
|
return (
|
|
<ButtonBase
|
|
className={classnames(className, 'mm-button-link', {
|
|
'mm-button-link--type-danger': danger,
|
|
})}
|
|
size={size}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|
|
|
|
ButtonLink.propTypes = {
|
|
/**
|
|
* An additional className to apply to the ButtonLink.
|
|
*/
|
|
className: PropTypes.string,
|
|
/**
|
|
* Boolean to change button type to Danger when true
|
|
*/
|
|
danger: PropTypes.bool,
|
|
/**
|
|
* The possible size values for ButtonLink: 'SIZES.AUTO', 'SIZES.SM', 'SIZES.MD', 'SIZES.LG',
|
|
* Default value is 'SIZES.MD'.
|
|
*/
|
|
size: PropTypes.oneOf(Object.values(BUTTON_LINK_SIZES)),
|
|
/**
|
|
* ButtonLink accepts all the props from ButtonBase
|
|
*/
|
|
...ButtonBase.propTypes,
|
|
};
|
|
|
|
export default ButtonLink;
|