PluginProbe
Gutenify – Visual Site Builder Blocks & Starter Templates / 0.0.1
Gutenify – Visual Site Builder Blocks & Starter Templates v0.0.1
1.9.0 1.8.0 1.7.0 1.6.6 1.6.5 1.6.4 trunk 0.0.1 0.0.2 0.0.3 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 All 74 releases
gutenify / src / components / blocks / count-down / deprecated.js

deprecated.js in Gutenify – Visual Site Builder Blocks & Starter Templates 0.0.1, at src/components/blocks/count-down/deprecated.js

74 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import attributes from './attributes';
2
3 const deprecated = [
4 {
5 attributes,
6
7 save( props ) {
8 const {
9 className,
10 attributes: {
11 dateTime,
12 showDays,
13 showHour,
14 showMinute,
15 showSecond,
16 showLabel,
17 customLabel,
18 customLabelDays,
19 customLabelHours,
20 customLabelMinutes,
21 customLabelSeconds,
22 containerWidth,
23 containerWidthUnit,
24 counterPosition
25 },
26 } = props;
27 let _className = `${className} timer-info`;
28 const getContainerWidthUnit = () => 'undefined' === typeof containerWidthUnit || '' === containerWidthUnit ? '%' : containerWidthUnit;
29 const getCounterPosition = () => 'undefined' === typeof counterPosition || '' === counterPosition ? 'center' : counterPosition;
30 const getCustomLabelDays = () => 'undefined' === typeof customLabelDays ? 'Days' : customLabelDays;
31 const getCustomLabelHours = () => 'undefined' === typeof customLabelHours ? 'Hours' : customLabelHours;
32 const getCustomLabelMinutes = () => 'undefined' === typeof customLabelMinutes ? 'Minutes' : customLabelMinutes;
33 const getCustomLabelSeconds = () => 'undefined' === typeof customLabelSeconds ? 'Seconds' : customLabelSeconds;
34 const getSelectedDate = 'undefined' !== typeof dateTime ? dateTime : 'test';
35
36 const isShowDays = () => 'undefined' === typeof showDays || true === showDays ? true : false;
37 const isShowLabel = () => 'undefined' === typeof showLabel || true === showLabel ? true : false;
38 const isShowHour = () => 'undefined' === typeof showHour || true === showHour ? true : false;
39 const isShowMinute = () => 'undefined' === typeof showMinute || true === showMinute ? true : false;
40 const isShowSecond = () => 'undefined' === typeof showSecond || true === showSecond ? true : false;
41 const isCustomLabel = 'undefined' === typeof customLabel || false === customLabel ? false : true;
42
43 return (
44 <div className={_className} style={{
45 width: `${containerWidth ? containerWidth : 100}${getContainerWidthUnit()}`,
46 marginTop: 0,
47 marginBottom: 0,
48 marginLeft: 'center' === getCounterPosition() || 'right' === getCounterPosition() ? 'auto' : 0,
49 marginRight: 'center' === getCounterPosition() || 'left' === getCounterPosition() ? 'auto' : 0,
50 }} >
51 <div className="timer-count-down" id="clockdiv" data-endtime={getSelectedDate}>
52 {isShowDays() && <><div className="time-part"><span className="days">{props.timerDays}</span>
53 {isShowLabel() && <div className="days-label smalltext">{ isCustomLabel? getCustomLabelDays():'Days'}</div>}
54 </div></>}
55
56 {isShowHour() && <><div className="time-part"><span className="hours">{props.timerHour}</span>
57 {isShowLabel() && <div className="hours-label smalltext">{isCustomLabel? getCustomLabelHours():'Hours'}</div>}
58 </div></>}
59
60 {isShowMinute() && <><div className="time-part"><span className="minutes">{props.timerMinute}</span>
61 {isShowLabel() && <div className="minutes-label smalltext">{isCustomLabel?getCustomLabelMinutes():'Minutes'}</div>}
62 </div></>}
63
64 {isShowSecond() && <div className="time-part"><span className="seconds">{props.timerSecond}</span>
65 {isShowLabel() && <div className="seconds-label smalltext">{isCustomLabel?getCustomLabelSeconds():'Seconds'}</div>}
66 </div>}
67 </div>
68 </div>
69 );
70 },
71 }
72 ];
73
74 export default deprecated;