PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.3.53
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.3.53
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 / pages / Rules / Tabs / DesignBlock / CountDownTime / CountdownTime.jsx

CountdownTime.jsx in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.3.53, at backend/views/components/Main/pages/Rules/Tabs/DesignBlock/CountDownTime/CountdownTime.jsx

52 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2 import { useDispatch, useSelector } from 'react-redux';
3 import ComingSoon from '../../../../../components/ComingSoon';
4 import { updateCountdown } from '../../../../../features/discount/discountSlice';
5 import useIsPro from '../../../../../hooks/useIsPro';
6 import BadgeActions from '../components/BadgeActions';
7 import BadgeComponentContainer from '../components/BadgeComponentContainer';
8 import BadgeTitle from '../components/BadgeTitle';
9 import ProFeatureButton from '../components/ProFeatureButton';
10 import Status from '../components/Status';
11 import CountdownTimeCard from './components/CountdownTimeCard';
12
13 const CountdownTime = ({ comingSoon = false }) => {
14 const dispatch = useDispatch();
15 const { countdown } = useSelector((state) => state.discount.design_blocks);
16 const isPro = useIsPro();
17
18 const tryNowUrl =
19 'https://discoplugin.com/pricing/?utm_source=bulk-table&utm_medium=free-to-pro&utm_campaign=from-display-page&utm_id=1';
20
21 const handleStatus = (status) => {
22 dispatch(updateCountdown({ name: 'enable', value: status }));
23 };
24
25 return (
26 <BadgeComponentContainer>
27 <div className="disco-relative">{comingSoon && <ComingSoon />}</div>
28 <CountdownTimeCard />
29 <BadgeTitle
30 title={__('Countdown Time', 'disco')}
31 url="https://discoplugin.com/docs/display-countdown-timer/"
32 className="disco-mt-3"
33 />
34 <BadgeActions>
35 <Status
36 status={countdown?.enable || false}
37 handleStatus={handleStatus}
38 disabled={!isPro}
39 dataTestid="countdown-time-status"
40 />
41 <ProFeatureButton
42 tryNowUrl={tryNowUrl}
43 componentToEdit="CountdownTimeEdit"
44 testId="countdown-time"
45 />
46 </BadgeActions>
47 </BadgeComponentContainer>
48 );
49 };
50
51 export default CountdownTime;
52