PluginProbe
Gutenify – Visual Site Builder Blocks & Starter Templates / 0.0.2
Gutenify – Visual Site Builder Blocks & Starter Templates v0.0.2
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 / google-maps / frontend.js

frontend.js in Gutenify – Visual Site Builder Blocks & Starter Templates 0.0.2, at src/components/blocks/google-maps/frontend.js

54 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { render, useEffect } from '@wordpress/element';
2 import { withState } from '@wordpress/compose';
3 import domReady from '@wordpress/dom-ready';
4
5 import GutenifyCountDownBlock from './Block';
6 import attributesDefaults from './attributesDefaults'
7
8 const Frontend = withState({
9 isCalenderVisible: false,
10 isTimerStart: false,
11 timerInterval: false,
12 dateTime: new Date(),
13 timerDays: '00',
14 timerHour: '00',
15 timerMinute: '00',
16 timerSecond: '00',
17 isExpired: false,
18 hideTimer: false
19 })((props) => {
20 let attributes = { ...attributesDefaults, ...props.options };
21
22 useEffect(() => {
23 // load Fonts
24 if (attributes.digitAttrs.typography.fontFamily) {
25 WebFont.load({
26 google: {
27 families: [attributes.digitAttrs.typography.fontFamily]
28 }
29 });
30 }
31
32 if (attributes.titleAttrs.typography.fontFamily) {
33 WebFont.load({
34 google: {
35 families: [attributes.titleAttrs.typography.fontFamily]
36 }
37 });
38 }
39 }, []);
40
41 return <>
42 <GutenifyCountDownBlock {...props} attributes={attributes} screen="frontend" />
43 </>;
44 })
45 domReady(function () {
46 //do something after DOM loads.
47 const allCountDown = document.getElementsByClassName('gutenify-google-maps-wrapper');
48 for (let i = 0; i < allCountDown.length; i++) {
49 const id = allCountDown[i].getAttribute('id');
50 const options = window[id];
51 render(<Frontend options={options} id={id} />, document.getElementById(id));
52 }
53 });
54