@nguyentc21/react-native-tooltip
Version:
Simple tooltip for React native app
47 lines (46 loc) • 936 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _ = require("..");
var _default = ({
dimension,
tooltipContentLayout,
safeAreaInsets
}) => {
const {
minTop,
minBottom,
minLeft,
minRight,
maxTop,
maxBottom,
maxLeft,
maxRight
} = (0, _.getLimitScreenPosition)({
dimension
});
const {
height = 0,
width = 0
} = tooltipContentLayout || {};
const {
top,
bottom,
left,
right
} = safeAreaInsets;
return {
minTop: minTop + top,
minBottom: minBottom + bottom,
minLeft: minLeft + left,
minRight: minRight + right,
maxTop: maxTop - height - bottom - top,
maxBottom: maxBottom - height - top - bottom,
maxLeft: maxLeft - width - right - left,
maxRight: maxRight - width - left - right
};
};
exports.default = _default;
//# sourceMappingURL=getLimitTooltipPosition.js.map