PluginProbe
Extendify / 3.2.1
Extendify v3.2.1
3.2.1 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 All 127 releases
extendify / src / Agent / workflows / settings / components / UpdateSiteVisibilityConfirm.jsx

UpdateSiteVisibilityConfirm.jsx in Extendify 3.2.1, at src/Agent/workflows/settings/components/UpdateSiteVisibilityConfirm.jsx

50 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2
3 export const UpdateSiteVisibilityConfirm = ({ onConfirm, onCancel }) => {
4 // skipAgent resolves no inputs, so the direction comes from the current state.
5 const isPublished = Boolean(window.extAgentData?.agentContext?.sitePublished);
6
7 const handleConfirm = () => {
8 onConfirm({
9 data: { visibility: isPublished ? 'unpublished' : 'published' },
10 shouldRefreshPage: true,
11 });
12 };
13
14 return (
15 <div className="mb-4 ms-2 me-2 flex flex-col rounded-lg border border-gray-300 bg-gray-50">
16 <div className="rounded-lg border-b border-gray-300 bg-white">
17 <div className="p-3">
18 <p className="m-0 p-0 text-sm text-gray-900">
19 {isPublished
20 ? __(
21 'Your site will be hidden from visitors until you publish it again. Confirm to take it offline.',
22 'extendify-local',
23 )
24 : __(
25 'Your site will become visible to everyone. Confirm to take it live.',
26 'extendify-local',
27 )}
28 </p>
29 </div>
30 </div>
31 <div className="flex justify-start gap-2 p-3">
32 <button
33 type="button"
34 className="w-full rounded-sm border border-gray-500 bg-white p-2 text-sm text-gray-900"
35 onClick={onCancel}
36 >
37 {__('Cancel', 'extendify-local')}
38 </button>
39 <button
40 type="button"
41 className="w-full rounded-sm border border-design-main bg-design-main p-2 text-sm text-white"
42 onClick={handleConfirm}
43 >
44 {__('Confirm', 'extendify-local')}
45 </button>
46 </div>
47 </div>
48 );
49 };
50