UNPKG

@gorhom/bottom-sheet

Version:

A performant interactive bottom sheet with fully configurable options 🚀

24 lines (18 loc) • 658 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizeSnapPoint = void 0; /** * Converts a snap point to fixed numbers. */ const normalizeSnapPoint = (snapPoint, containerHeight, _topInset, _bottomInset, _$modal = false) => { 'worklet'; let normalizedSnapPoint = snapPoint; // percentage snap point if (typeof normalizedSnapPoint === 'string') { normalizedSnapPoint = Number(normalizedSnapPoint.split('%')[0]) * containerHeight / 100; } return Math.max(0, containerHeight - normalizedSnapPoint); }; exports.normalizeSnapPoint = normalizeSnapPoint; //# sourceMappingURL=normalizeSnapPoint.js.map