PluginProbe
Extendify / 3.1.5
Extendify v3.1.5
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / PageCreator / components / ConfirmationModal.jsx

ConfirmationModal.jsx in Extendify 3.1.5, at src/PageCreator/components/ConfirmationModal.jsx

54 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { useActivityStore } from '@shared/state/activity';
2 import { Button, Modal as Dialog } from '@wordpress/components';
3 import { __ } from '@wordpress/i18n';
4
5 const { adminUrl } = window.extSharedData;
6
7 export const ConfirmationModal = ({
8 setConfirmationOpen,
9 confirmationOpen,
10 setModalOpen,
11 }) => {
12 const { incrementActivity } = useActivityStore();
13
14 const confirmDeletion = () => {
15 setConfirmationOpen(false);
16 setModalOpen(true);
17 incrementActivity('page-creator-delete-content-button-click');
18 };
19
20 return (
21 <Dialog
22 onRequestClose={() => setConfirmationOpen(false)}
23 className="extendify-page-creator"
24 size="medium"
25 aria-labelledby="page-creator-confirmation"
26 role="dialog"
27 isOpen={confirmationOpen}
28 title={__('Confirmation', 'extendify-local')}
29 >
30 <div className="flex flex-col space-y-6 text-sm">
31 <div>
32 {__(
33 'Do you want to replace existing content or create a new page?',
34 'extendify-local',
35 )}
36 </div>
37 <div className="flex w-full items-center justify-end space-x-2">
38 <Button size="default" variant="tertiary" onClick={confirmDeletion}>
39 {__('Delete existing content', 'extendify-local')}
40 </Button>
41 <Button
42 variant="primary"
43 size="default"
44 href={`${adminUrl}post-new.php?post_type=page&ext-open-ai-creator=1`}
45 target="_blank"
46 >
47 {__('Create a new page', 'extendify-local')}
48 </Button>
49 </div>
50 </div>
51 </Dialog>
52 );
53 };
54