PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.3.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.3.0
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / modules / gutenberg / src / controls / unitWiseMinMaxOption.js

unitWiseMinMaxOption.js in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.3.0, at modules/gutenberg/src/controls/unitWiseMinMaxOption.js

26 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { useDeviceType } from '@Controls/getPreviewType';
2 export const limitMax = ( unitVal, props, isResponsiveMinMax ) => {
3 let max = 0;
4 if( isResponsiveMinMax ){
5 const deviceType = useDeviceType(); // eslint-disable-line react-hooks/rules-of-hooks
6 const responsiveUnit = ( unitVal ) ? unitVal : props.data[deviceType.toLowerCase()].value;
7 max = ( responsiveUnit && props.data[deviceType.toLowerCase()]?.max ) ? props.data[deviceType.toLowerCase()].max : props.max;
8 } else {
9 max = ( unitVal && props.limitMax ) ? props.limitMax[unitVal] : props.max;
10 }
11
12 return max;
13 };
14
15 export const limitMin = ( unitVal, props, isResponsiveMinMax ) => {
16 let min = 0;
17 if( isResponsiveMinMax ){
18 const deviceType = useDeviceType(); // eslint-disable-line react-hooks/rules-of-hooks
19 const responsiveUnit = ( unitVal ) ? unitVal : props.data[deviceType.toLowerCase()].value;
20 min = ( responsiveUnit && props.data[deviceType.toLowerCase()]?.min ) ? props.data[deviceType.toLowerCase()].min : props.min;
21 } else {
22 min = ( unitVal && props.limitMin ) ? props.limitMin[unitVal] : props.min;
23 }
24 return min;
25 };
26