@nexara/nativeflow
Version:
Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.
22 lines (21 loc) • 758 B
JavaScript
import deviceScreenSizeCategory from "./DeviceSizeCategory.js";
const getGridValue = (propsSizeObj, windowWidth) => {
const propsSizeArray = Object.entries(propsSizeObj);
let screenSizeCategory = deviceScreenSizeCategory(windowWidth);
let gridValue = 0;
if (!propsSizeObj[screenSizeCategory.size]) {
const arrIndex = propsSizeArray.findIndex(([size]) => size === screenSizeCategory.size);
for (let index = arrIndex - 1; index >= 0; index--) {
if (propsSizeArray[index]?.[1]) {
gridValue = propsSizeArray[index]?.[1];
break;
}
}
} else {
gridValue = propsSizeObj[screenSizeCategory.size];
}
return gridValue;
};
export default getGridValue;
//# sourceMappingURL=CalculateGridSize.js.map
;