PluginProbe
Hello Plus / 1.2.0
Hello Plus v1.2.0
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.7.3 All 30 releases
hello-plus / modules / admin / assets / js / components / dialog / dialog.js

dialog.js in Hello Plus 1.2.0, at modules/admin/assets/js/components/dialog/dialog.js

51 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import Dialog from '@elementor/ui/Dialog';
2 import DialogActions from '@elementor/ui/DialogActions';
3 import DialogContent from '@elementor/ui/DialogContent';
4 import DialogContentText from '@elementor/ui/DialogContentText';
5 import DialogHeader from '@elementor/ui/DialogHeader';
6 import DialogTitle from '@elementor/ui/DialogTitle';
7 import Button from '@elementor/ui/Button';
8 import Typography from '@elementor/ui/Typography';
9 import { __ } from '@wordpress/i18n';
10
11 export const DialogModal = (
12 {
13 onClose,
14 approveButtonText,
15 approveButtonOnClick,
16 approveButtonUrl,
17 title,
18 text,
19 isLoading,
20 },
21 ) => {
22 return (
23 <Dialog
24 open
25 onClose={ onClose }
26 aria-labelledby="alert-dialog-title"
27 aria-describedby="alert-dialog-description"
28 sx={ { zIndex: 100001 } }
29 >
30 <DialogHeader onClose={ () => onClose() }>
31 <DialogTitle><Typography sx={ { color: 'text.secondary' } }>{ title }</Typography></DialogTitle>
32 </DialogHeader>
33
34 <DialogContent >
35 <DialogContentText id="alert-dialog-description">
36 { text }
37 </DialogContentText>
38 </DialogContent>
39
40 <DialogActions>
41 <Button onClick={ onClose } color="secondary">
42 { __( 'Cancel', 'hello-plus' ) }
43 </Button>
44 <Button disabled={ isLoading } target="_blank" rel="opener" href={ approveButtonUrl } onClick={ approveButtonOnClick } variant="contained">
45 { isLoading ? __( 'Processing…', 'hello-plus' ) : approveButtonText }
46 </Button>
47 </DialogActions>
48 </Dialog>
49 );
50 };
51