@nguyentc21/react-native-tooltip
Version:
Simple tooltip for React native app
40 lines • 817 B
JavaScript
import { getLimitScreenPosition } from '..';
export default ({
dimension,
tooltipContentLayout,
safeAreaInsets
}) => {
const {
minTop,
minBottom,
minLeft,
minRight,
maxTop,
maxBottom,
maxLeft,
maxRight
} = 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
};
};
//# sourceMappingURL=getLimitTooltipPosition.js.map