github.com/martinohmann/rfoutlet@v1.2.1-0.20220707195255-8a66aa411105/web/src/components/Dialog.js (about) 1 import React from 'react'; 2 import PropTypes from 'prop-types'; 3 import MaterialDialog from '@material-ui/core/Dialog'; 4 import DialogAppBar from './DialogAppBar'; 5 6 export default function Dialog(props) { 7 const { 8 children, 9 onClose, 10 onDone, 11 doneButtonDisabled, 12 doneButtonText, 13 title 14 } = props; 15 16 return ( 17 <MaterialDialog fullScreen open onClose={onClose}> 18 <DialogAppBar 19 title={title} 20 onClose={onClose} 21 onDone={onDone} 22 doneButtonDisabled={doneButtonDisabled} 23 doneButtonText={doneButtonText} 24 /> 25 {children} 26 </MaterialDialog> 27 ); 28 } 29 30 Dialog.propTypes = { 31 onClose: PropTypes.func.isRequired, 32 onDone: PropTypes.func, 33 title: PropTypes.string.isRequired, 34 doneButtonDisabled: PropTypes.bool, 35 doneButtonText: PropTypes.any, 36 };