1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/app/components/ui/dialog/index.js
2020-11-02 17:41:28 -06:00

27 lines
643 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,
}