MCPcopy
hub / github.com/callstack/react-native-paper / getTooltipPosition

Function getTooltipPosition

src/components/Tooltip/utils.ts:125–141  ·  view source on GitHub ↗
(
  { children, tooltip, measured }: Measurement,
  component: React.ReactElement<{
    style: StyleProp<ViewStyle>;
  }>
)

Source from the content-addressed store, hash-verified

123};
124
125export const getTooltipPosition = (
126 { children, tooltip, measured }: Measurement,
127 component: React.ReactElement<{
128 style: StyleProp<ViewStyle>;
129 }>
130): {} | { left: number; top: number } => {
131 if (!measured) return {};
132 let measures = children;
133 if (component.props.style) {
134 measures = getChildrenMeasures(component.props.style, children);
135 }
136
137 return {
138 left: getTooltipXPosition(measures, tooltip),
139 top: getTooltipYPosition(measures, tooltip),
140 };
141};

Callers 1

TooltipFunction · 0.90

Calls 3

getChildrenMeasuresFunction · 0.85
getTooltipXPositionFunction · 0.85
getTooltipYPositionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…