mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
76a2a9bb8b
* @metamask/eslint-config@5.0.0 * Update eslintrc and prettierrc * yarn lint:fix
27 lines
649 B
JavaScript
27 lines
649 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import classnames from 'classnames';
|
|
|
|
export default function Dialog(props) {
|
|
const { children, type, className, onClick } = props;
|
|
return (
|
|
<div
|
|
className={classnames('dialog', className, {
|
|
'dialog--message': type === 'message',
|
|
'dialog--error': type === 'error',
|
|
'dialog--warning': type === 'warning',
|
|
})}
|
|
onClick={onClick}
|
|
>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
Dialog.propTypes = {
|
|
className: PropTypes.string,
|
|
children: PropTypes.node,
|
|
type: PropTypes.oneOf(['message', 'error', 'warning']),
|
|
onClick: PropTypes.func,
|
|
};
|