PluginProbe
Gutenify – Visual Site Builder Blocks & Starter Templates / 0.0.3
Gutenify – Visual Site Builder Blocks & Starter Templates v0.0.3
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 / common / GutenifyDatePicker.js

GutenifyDatePicker.js in Gutenify – Visual Site Builder Blocks & Starter Templates 0.0.3, at src/components/common/GutenifyDatePicker.js

27 lines 887 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { withState } from '@wordpress/compose';
2 import { Button, Popover, DateTimePicker } from '@wordpress/components';
3
4 const GutenifyDatePicker = withState({
5 isVisible: false,
6 })(({ isVisible, setState, onChange, dateTime, content }) => {
7 const toggleVisible = () => {
8 setState((state) => ({ isVisible: !state.isVisible }));
9 };
10 return (
11 <>
12 <Button isDefault onClick={toggleVisible} isLink={true}>
13 {content}
14 {isVisible && (
15 <Popover position="bottom left" onFocusOutside={(e) => console.log(e)
16 }>
17 <DateTimePicker
18 currentDate={dateTime}
19 onChange={onChange} />
20 </Popover>
21 )}
22 </Button>
23 </>
24 );
25 });
26
27 export default GutenifyDatePicker;