Skip to content

Commit

Permalink
hideProductTrainingTooltip for RENAME_SAVED_SEARCH tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
rayane-djouah committed Jan 3, 2025
1 parent 2042262 commit 06f1b75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/pages/Search/SavedSearchItemThreeDotMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import CONST from '@src/CONST';
type SavedSearchItemThreeDotMenuProps = {
menuItems: PopoverMenuItem[];
isDisabledItem: boolean;
hideProductTrainingTooltip?: () => void;
};

function SavedSearchItemThreeDotMenu({menuItems, isDisabledItem}: SavedSearchItemThreeDotMenuProps) {
function SavedSearchItemThreeDotMenu({menuItems, isDisabledItem, hideProductTrainingTooltip}: SavedSearchItemThreeDotMenuProps) {
const threeDotsMenuContainerRef = useRef<View>(null);
const [threeDotsMenuPosition, setThreeDotsMenuPosition] = useState({horizontal: 0, vertical: 0});
const styles = useThemeStyles();
Expand All @@ -22,6 +23,7 @@ function SavedSearchItemThreeDotMenu({menuItems, isDisabledItem}: SavedSearchIte
<ThreeDotsMenu
menuItems={menuItems}
onIconPress={() => {
hideProductTrainingTooltip?.();
threeDotsMenuContainerRef.current?.measureInWindow((x, y, width) => {
setThreeDotsMenuPosition({
horizontal: x + width,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search/SearchTypeMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ function SearchTypeMenu({queryJSON, searchName}: SearchTypeMenuProps) {
<SavedSearchItemThreeDotMenu
menuItems={getOverflowMenu(title, Number(key), item.query)}
isDisabledItem={item.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE}
hideProductTrainingTooltip={index === 0 ? hideProductTrainingTooltip : undefined}
/>
),
styles: [styles.alignItemsCenter],
Expand All @@ -165,7 +166,6 @@ function SearchTypeMenu({queryJSON, searchName}: SearchTypeMenuProps) {
tooltipShiftHorizontal: -32,
tooltipShiftVertical: 15,
tooltipWrapperStyle: [styles.bgPaleGreen, styles.mh4, styles.pv2],
onHideTooltip: hideProductTrainingTooltip,
renderTooltipContent: renderProductTrainingTooltip,
};
}
Expand Down

0 comments on commit 06f1b75

Please sign in to comment.