Skip to content

Commit

Permalink
refactor duplicate code after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cdOut committed Sep 26, 2024
1 parent a6f182c commit 0309363
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/Search/SearchPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import type {SearchDataTypes, SearchReport} from '@src/types/onyx/SearchResults'
import type DeepValueOf from '@src/types/utils/DeepValueOf';
import type IconAsset from '@src/types/utils/IconAsset';
import {useSearchContext} from './SearchContext';
import SearchRouterInput from './SearchRouter/SearchRouterInput';
import SearchButton from './SearchRouter/SearchButton';
import SearchRouterInput from './SearchRouter/SearchRouterInput';
import type {SearchQueryJSON} from './types';

type HeaderWrapperProps = Pick<HeaderWithBackButtonProps, 'icon' | 'children'> & {
Expand Down Expand Up @@ -288,8 +288,6 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa
Navigation.navigate(ROUTES.SEARCH_ADVANCED_FILTERS);
};

const displaySearchRouter = SearchUtils.isCannedSearchQuery(queryJSON);

return (
<HeaderWrapper
icon={headerIcon}
Expand All @@ -316,7 +314,7 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa
onPress={onPress}
/>
)}
{displaySearchRouter && <SearchButton />}
{isCannedQuery && <SearchButton />}
</HeaderWrapper>
);
}
Expand Down

0 comments on commit 0309363

Please sign in to comment.