From 299040a5fa609d126ed0fc877faed317c714dc48 Mon Sep 17 00:00:00 2001 From: mkzie2 Date: Mon, 23 Sep 2024 13:34:11 +0700 Subject: [PATCH 1/4] Remove viewing search query in the list and add bookmark icon for mobile --- src/pages/Search/SearchTypeMenuNarrow.tsx | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/pages/Search/SearchTypeMenuNarrow.tsx b/src/pages/Search/SearchTypeMenuNarrow.tsx index 0158a15bfc41..c8aaa2e125e4 100644 --- a/src/pages/Search/SearchTypeMenuNarrow.tsx +++ b/src/pages/Search/SearchTypeMenuNarrow.tsx @@ -84,20 +84,6 @@ function SearchTypeMenuNarrow({typeMenuItems, activeItemIndex, queryJSON, title, }; }); - if (title) { - items.push({ - text: title, - onSelected: closeMenu, - isSelected: !currentSavedSearch, - icon: Expensicons.Filters, - iconFill: theme.iconSuccessFill, - success: true, - containerStyle: undefined, - iconRight: Expensicons.Checkmark, - shouldShowRightIcon: false, - }); - } - return items; }, [typeMenuItems, activeItemIndex, title, theme, singleExecution, closeMenu, currentSavedSearch]); @@ -109,6 +95,7 @@ function SearchTypeMenuNarrow({typeMenuItems, activeItemIndex, queryJSON, title, text: item.title ?? '', styles: [styles.textSupporting], onSelected: item.onPress, + icon: Expensicons.Bookmark, shouldShowRightComponent: true, rightComponent: ( Date: Mon, 23 Sep 2024 13:46:51 +0700 Subject: [PATCH 2/4] fix lint --- src/pages/Search/SearchTypeMenuNarrow.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Search/SearchTypeMenuNarrow.tsx b/src/pages/Search/SearchTypeMenuNarrow.tsx index c8aaa2e125e4..3ba9857892d2 100644 --- a/src/pages/Search/SearchTypeMenuNarrow.tsx +++ b/src/pages/Search/SearchTypeMenuNarrow.tsx @@ -85,7 +85,7 @@ function SearchTypeMenuNarrow({typeMenuItems, activeItemIndex, queryJSON, title, }); return items; - }, [typeMenuItems, activeItemIndex, title, theme, singleExecution, closeMenu, currentSavedSearch]); + }, [typeMenuItems, activeItemIndex, title, theme, singleExecution]); const menuIcon = useMemo(() => (title ? Expensicons.Filters : popoverMenuItems[activeItemIndex]?.icon ?? Expensicons.Receipt), [activeItemIndex, popoverMenuItems, title]); const menuTitle = useMemo(() => title ?? popoverMenuItems[activeItemIndex]?.text, [activeItemIndex, popoverMenuItems, title]); From 5791e4aef6cc1376680f9e5741d0a6b7013c5fc8 Mon Sep 17 00:00:00 2001 From: mkzie2 Date: Mon, 23 Sep 2024 16:11:02 +0700 Subject: [PATCH 3/4] only remove viewing search if it's saved search --- src/pages/Search/SearchTypeMenuNarrow.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/pages/Search/SearchTypeMenuNarrow.tsx b/src/pages/Search/SearchTypeMenuNarrow.tsx index 3ba9857892d2..d0053f45be74 100644 --- a/src/pages/Search/SearchTypeMenuNarrow.tsx +++ b/src/pages/Search/SearchTypeMenuNarrow.tsx @@ -84,8 +84,22 @@ function SearchTypeMenuNarrow({typeMenuItems, activeItemIndex, queryJSON, title, }; }); + if (title && !currentSavedSearch) { + items.push({ + text: title, + onSelected: closeMenu, + isSelected: !currentSavedSearch, + icon: Expensicons.Filters, + iconFill: theme.iconSuccessFill, + success: true, + containerStyle: undefined, + iconRight: Expensicons.Checkmark, + shouldShowRightIcon: false, + }); + } + return items; - }, [typeMenuItems, activeItemIndex, title, theme, singleExecution]); + }, [typeMenuItems, activeItemIndex, title, theme, singleExecution, closeMenu, currentSavedSearch]); const menuIcon = useMemo(() => (title ? Expensicons.Filters : popoverMenuItems[activeItemIndex]?.icon ?? Expensicons.Receipt), [activeItemIndex, popoverMenuItems, title]); const menuTitle = useMemo(() => title ?? popoverMenuItems[activeItemIndex]?.text, [activeItemIndex, popoverMenuItems, title]); From ca6f5a018adbb791be0cda3da255821c337c32ea Mon Sep 17 00:00:00 2001 From: mkzie2 Date: Tue, 24 Sep 2024 16:19:17 +0700 Subject: [PATCH 4/4] fix icon fill --- src/pages/Search/SearchTypeMenuNarrow.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Search/SearchTypeMenuNarrow.tsx b/src/pages/Search/SearchTypeMenuNarrow.tsx index d0053f45be74..4d51044c47dd 100644 --- a/src/pages/Search/SearchTypeMenuNarrow.tsx +++ b/src/pages/Search/SearchTypeMenuNarrow.tsx @@ -110,6 +110,7 @@ function SearchTypeMenuNarrow({typeMenuItems, activeItemIndex, queryJSON, title, styles: [styles.textSupporting], onSelected: item.onPress, icon: Expensicons.Bookmark, + iconFill: currentSavedSearch?.hash === item.hash ? theme.iconSuccessFill : theme.icon, shouldShowRightComponent: true, rightComponent: (