UNPKG

native-variants

Version:

A library for handling variants in React Native components with theme support.

19 lines 833 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hq = exports.wq = void 0; const react_native_1 = require("react-native"); let screenWidth = react_native_1.Dimensions.get("window").width; let screenHeight = react_native_1.Dimensions.get("window").height; const wq = (widthPercent) => { const elemWidth = typeof widthPercent === "number" ? widthPercent : parseFloat(widthPercent); return react_native_1.PixelRatio.roundToNearestPixel((screenWidth * elemWidth) / 100); }; exports.wq = wq; const hq = (heightPercent) => { const elemHeight = typeof heightPercent === "number" ? heightPercent : parseFloat(heightPercent); return react_native_1.PixelRatio.roundToNearestPixel((screenHeight * elemHeight) / 100); }; exports.hq = hq; //# sourceMappingURL=media-query.js.map