PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.3
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.3
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / hooks / use-responsive.js

use-responsive.js in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.3, at gutenberg/hooks/use-responsive.js

24 lines 457 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { useDispatch, useSelect } from '@wordpress/data';
2
3 const { ghostkitVariables } = window;
4
5 const allDevices = { ...ghostkitVariables.media_sizes };
6
7 export default function useResponsive() {
8 const { device } = useSelect((select) => {
9 const { getDevice } = select('ghostkit/responsive');
10
11 return {
12 device: getDevice(),
13 };
14 });
15
16 const { setDevice } = useDispatch('ghostkit/responsive');
17
18 return {
19 device,
20 setDevice,
21 allDevices,
22 };
23 }
24