UNPKG

@nexara/nativeflow

Version:

Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.

36 lines (35 loc) 831 B
"use strict"; import { Dimensions } from "react-native"; import { BreakPoints } from "../constants/index.js"; const { width: SCREEN_WIDTH } = Dimensions.get('window'); const deviceScreenSizeCategory = (windowWidth = SCREEN_WIDTH) => { if (windowWidth >= BreakPoints.xl) { return { size: 'xl', value: BreakPoints.xl }; } else if (windowWidth >= BreakPoints.lg) { return { size: 'lg', value: BreakPoints.xl }; } else if (windowWidth >= BreakPoints.md) { return { size: 'md', value: BreakPoints.md }; } else if (windowWidth >= BreakPoints.sm) { return { size: 'sm', value: BreakPoints.sm }; } return { size: 'xs', value: BreakPoints.xs }; }; export default deviceScreenSizeCategory; //# sourceMappingURL=DeviceSizeCategory.js.map