UNPKG

@arpitbhalla/rneui-base-dev

Version:
34 lines (33 loc) 1.54 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTooltipStyle = void 0; var react_native_1 = require("react-native"); var helpers_1 = require("../../helpers"); var getTooltipCoordinate_1 = __importDefault(require("./getTooltipCoordinate")); var getTooltipStyle = function (_a) { var _b; var yOffset = _a.yOffset, xOffset = _a.xOffset, elementHeight = _a.elementHeight, elementWidth = _a.elementWidth, width = _a.width, height = _a.height, withPointer = _a.withPointer, backgroundColor = _a.backgroundColor, containerStyle = _a.containerStyle; var _c = (0, getTooltipCoordinate_1.default)(xOffset, yOffset, elementWidth, elementHeight, helpers_1.ScreenWidth, helpers_1.ScreenHeight, width, height, withPointer), x = _c.x, y = _c.y; return react_native_1.StyleSheet.flatten([ (_b = { position: 'absolute' }, _b[react_native_1.I18nManager.isRTL ? 'right' : 'left'] = x, _b.top = y, _b.width = width, _b.height = height, _b.backgroundColor = backgroundColor, _b.display = 'flex', _b.alignItems = 'center', _b.justifyContent = 'center', _b.flex = 1, _b.borderRadius = 10, _b.padding = 10, _b), containerStyle, ]); }; exports.getTooltipStyle = getTooltipStyle;