Skip to content

Commit 1bf9857

Browse files
committed
make suggested change
1 parent f0217bb commit 1bf9857

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

src/components/Tooltip/BaseGenericTooltip/index.native.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@ function BaseGenericTooltip({
115115
);
116116
}
117117

118+
const contentWithOrWithoutPressable = isEducationTooltip ? (
119+
<PressableWithoutFeedback
120+
onPress={onTooltipPress}
121+
role={CONST.ROLE.TOOLTIP}
122+
accessibilityLabel={CONST.ROLE.TOOLTIP}
123+
>
124+
{content}
125+
</PressableWithoutFeedback>
126+
) : (
127+
content
128+
);
129+
118130
return (
119131
<Portal hostName={shouldTeleportPortalToModalLayer ? 'modal' : undefined}>
120132
{shouldUseOverlay && <TransparentOverlay onPress={onHideTooltip} />}
@@ -135,13 +147,7 @@ function BaseGenericTooltip({
135147
setWrapperMeasuredHeight(height);
136148
}}
137149
>
138-
<PressableWithoutFeedback
139-
onPress={onTooltipPress}
140-
role={CONST.ROLE.TOOLTIP}
141-
accessibilityLabel={CONST.ROLE.TOOLTIP}
142-
>
143-
{content}
144-
</PressableWithoutFeedback>
150+
{contentWithOrWithoutPressable}
145151
<View style={pointerWrapperStyle}>
146152
<View style={pointerStyle} />
147153
</View>

src/components/Tooltip/BaseGenericTooltip/index.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,19 @@ function BaseGenericTooltip({
140140
);
141141
}
142142

143+
const contentWithOrWithoutPressable = isEducationTooltip ? (
144+
<PressableWithoutFeedback
145+
onPress={onTooltipPress}
146+
ref={pressableRef}
147+
role={CONST.ROLE.TOOLTIP}
148+
accessibilityLabel={CONST.ROLE.TOOLTIP}
149+
>
150+
{content}
151+
</PressableWithoutFeedback>
152+
) : (
153+
content
154+
);
155+
143156
const body = document.querySelector('body');
144157

145158
if (!body) {
@@ -153,14 +166,7 @@ function BaseGenericTooltip({
153166
ref={viewRef(rootWrapper)}
154167
style={[rootWrapperStyle, animationStyle]}
155168
>
156-
<PressableWithoutFeedback
157-
onPress={onTooltipPress}
158-
ref={pressableRef}
159-
role={CONST.ROLE.TOOLTIP}
160-
accessibilityLabel={CONST.ROLE.TOOLTIP}
161-
>
162-
{content}
163-
</PressableWithoutFeedback>
169+
{contentWithOrWithoutPressable}
164170
<View style={pointerWrapperStyle}>
165171
<View style={pointerStyle} />
166172
</View>

0 commit comments

Comments
 (0)