reflexy
Version:
Flexbox layout react components
14 lines (13 loc) • 549 B
JavaScript
export const getFillValue = (propValue) => {
return typeof propValue === 'number'
? `${Math.min(+propValue, 1) * 100}%`
: (propValue && '100%') || undefined;
};
const getScrollableValue = (scrollableValue) => {
return typeof scrollableValue === 'string'
? scrollableValue
: (scrollableValue === true && 'auto') || (scrollableValue === false && 'hidden') || undefined;
};
export const getOverflowValue = (overflowValue, scrollableValue) => {
return overflowValue ?? getScrollableValue(scrollableValue);
};