Commit ec3d2b51 authored by Patrik Meijer's avatar Patrik Meijer
Browse files

Add ConfirmDialog

parent e35f77ea
import React from 'react';
import PropTypes from 'prop-types';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogTitle from '@material-ui/core/DialogTitle';
function ConfirmDialog(props) {
return (
onClose={() => props.onClose(false)}
<DialogTitle id="alert-dialog-title">{props.title}</DialogTitle>
<DialogContentText id="alert-dialog-description">
<Button onClick={() => props.onClose(false)} color="primary">
<Button onClick={() => props.onClose(true)} color="primary" autoFocus>
ConfirmDialog.propTypes = {
title: PropTypes.string.isRequired,
message: PropTypes.string.isRequired,
noButtonText: PropTypes.string,
yesButtonText: PropTypes.string,
onClose: PropTypes.func,
ConfirmDialog.defaultProps = {
onClose: (ok) => {
console.log(`OK was${ok ? '' : ' not'} pressed`);
noButtonText: 'Cancel',
yesButtonText: 'OK',
export default ConfirmDialog;
export {default} from './ConfirmDialog';
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment