react-native-dropdown-autocomplete
Version:
[npm-badge]: https://img.shields.io/npm/v/react-native-dropdown-autocomplete.svg?colorA=6b7c93&colorB=5ab1b8&style=flat-square [npm-url]: https://www.npmjs.com/package/react-native-dropdown-autocomplete [npm-downloads]: https://img.shields.io/npm/dt/react
26 lines (21 loc) • 658 B
JavaScript
import {Dimensions, Platform} from "react-native";
const {height, width} = Dimensions.get("window");
export const isIos = Platform.OS === "ios";
export const isX = (() => {
return (
Platform.OS === "ios" &&
!Platform.isPad &&
!Platform.isTVOS &&
(height === 812 || width === 812 || (height === 896 || width === 896))
);
})();
export const sleep = (ms, rejecting) =>
new Promise((resolve, reject) => {
if (!rejecting) {
return setTimeout(resolve, ms);
}
return setTimeout(reject, ms);
});
export const responsiveFontSize = (size, factor = 0.857142857, w = 360) => {
return width <= w ? size * factor : size;
};