Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kicu committed Sep 10, 2024
1 parent f8803d3 commit 4e1b90c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/Search/SearchPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import type HeaderWithBackButtonProps from '@components/HeaderWithBackButton/typ
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import * as Illustrations from '@components/Icon/Illustrations';
import SearchButton from '@components/Search/SearchRouter/SearchButton';
import type {ReportActionListItemType, ReportListItemType, TransactionListItemType} from '@components/SelectionList/types';
import Text from '@components/Text';
import useActiveWorkspace from '@hooks/useActiveWorkspace';
Expand All @@ -32,6 +31,7 @@ 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 SearchButton from './SearchRouter/SearchButton';
import type {SearchQueryJSON} from './types';

type HeaderWrapperProps = Pick<HeaderWithBackButtonProps, 'title' | 'subtitle' | 'icon' | 'children'> & {
Expand Down
14 changes: 9 additions & 5 deletions src/components/Search/SearchRouter/SearchRouterContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback, useContext, useState} from 'react';
import React, {useCallback, useContext, useMemo, useState} from 'react';
import type ChildrenProps from '@src/types/utils/ChildrenProps';

const defaultSearchContext = {
Expand All @@ -17,10 +17,14 @@ function SearchRouterContextProvider({children}: ChildrenProps) {
setIsSearchRouterDisplayed(!isSearchRouterDisplayed);
}, [isSearchRouterDisplayed]);

const routerContext = {
isSearchRouterDisplayed,
toggleSearchRouter,
};
const routerContext = useMemo(
() => ({
isSearchRouterDisplayed,
toggleSearchRouter,
}),
[isSearchRouterDisplayed, toggleSearchRouter],
);

return <Context.Provider value={routerContext}>{children}</Context.Provider>;
}

Expand Down

0 comments on commit 4e1b90c

Please sign in to comment.