@devvie/bottom-sheet
Version:
The 😎smart , 📦tiny , and 🎗flexible bottom sheet your app craves 🚀
19 lines (18 loc) • 660 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
/**
* Normalizes height to a number and clamps it
* so it's not bigger that device screen height
*/
const normalizeHeight = height => {
const DEVICE_SCREEN_HEIGHT = _reactNative.Dimensions.get('window').height;
let clampedHeight = DEVICE_SCREEN_HEIGHT;
if (typeof height === 'number') clampedHeight = height < 0 ? 0 : height > DEVICE_SCREEN_HEIGHT ? DEVICE_SCREEN_HEIGHT : height;
return clampedHeight;
};
var _default = exports.default = normalizeHeight;
//# sourceMappingURL=normalizeHeight.js.map