mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
27 lines
643 B
JavaScript
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,
|
|
}
|