PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.4.11
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.4.11
1.4.21 1.4.20 1.4.19 1.4.18 1.4.17 1.4.16 1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 All 184 releases
disco / backend / views / components / Main / components / PopUp.jsx

PopUp.jsx in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.4.11, at backend/views/components/Main/components/PopUp.jsx

80 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { Dialog } from '@headlessui/react';
2 import { XMarkIcon } from '@heroicons/react/24/solid';
3 import { __ } from '@wordpress/i18n';
4
5 const Popup = ({
6 title = 'Products Added',
7 data = [],
8 open = false,
9 onClose = () => {},
10 }) => {
11 const totalCount = data.length.toString().padStart(2, '0');
12
13 return (
14 <Dialog
15 open={open}
16 onClose={onClose}
17 className="disco-relative disco-z-50"
18 >
19 <div
20 className="disco-fixed disco-inset-0 disco-bg-black/50"
21 aria-hidden="true"
22 />
23 <div className="disco-fixed disco-inset-0 disco-flex disco-items-center disco-justify-center disco-p-2">
24 <Dialog.Panel className="disco-bg-white disco-rounded-xl disco-shadow-2xl disco-min-w-xs disco-p-4 disco-max-h-[60vh] disco-flex disco-flex-col">
25 <Dialog.Title className="disco-text-lg disco-font-semibold disco-mb-4 disco-flex disco-justify-between disco-items-center">
26 <div className="disco-flex disco-items-center disco-gap-2">
27 {title}
28 <span className="disco-text-lg disco-font-medium disco-text-gray-600">
29 ({totalCount})
30 </span>
31 </div>
32 <button
33 onClick={onClose}
34 className="disco-text-gray-500 hover:disco-text-black disco-text-xl disco-font-light"
35 >
36 <XMarkIcon className="disco-size-5 disco-text-red-700" />
37 </button>
38 </Dialog.Title>
39
40 {/* 2. Content: Product List */}
41 {data.length > 0 ? (
42 <div className="disco-space-y-1 disco-flex-grow disco-overflow-y-auto disco-p-2 disco-rounded-md disco-shadow">
43 {data.map((item) => (
44 <div
45 key={item.id}
46 className="disco-p-1 disco-flex disco-items-center disco-gap-3"
47 >
48 <div className="disco-w-6 disco-h-6 disco-flex disco-items-center disco-justify-center disco-text-xl">
49 {item.image ? (
50 <img
51 src={item.image}
52 alt={item.name}
53 className="disco-w-6 disco-h-6 disco-rounded"
54 />
55 ) : (
56 <span className="disco-text-base">
57 {item.emoji || '📦'}
58 </span>
59 )}
60 </div>
61
62 <p className="disco-text-gray-700 disco-font-light">
63 {item.id} - {item.name}
64 </p>
65 </div>
66 ))}
67 </div>
68 ) : (
69 <div className="disco-text-center disco-text-gray-500 disco-py-8">
70 {__('No items available.', 'disco')}
71 </div>
72 )}
73 </Dialog.Panel>
74 </div>
75 </Dialog>
76 );
77 };
78
79 export default Popup;
80