Skip to content

Commit

Permalink
Merge pull request #47931 from Expensify/cmartins-enableFilters
Browse files Browse the repository at this point in the history
  • Loading branch information
blimpich authored Aug 26, 2024
2 parents added91 + d9cd811 commit a048f92
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ function Button(
/>
</View>
)}
{textComponent}
{!!text && textComponent}
</View>
{shouldShowRightIcon && (
<View style={[styles.justifyContentCenter, large ? styles.ml2 : styles.ml1, iconRightStyles]}>
Expand Down
6 changes: 6 additions & 0 deletions src/components/Search/SearchPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {useMemo} from 'react';
import type {StyleProp, TextStyle} from 'react-native';
import {View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import Button from '@components/Button';
import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu';
import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types';
import Header from '@components/Header';
Expand Down Expand Up @@ -301,6 +302,11 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa
style={styles.ml2}
/>
)}
<Button
text={translate('search.filtersHeader')}
icon={Expensicons.Filters}
onPress={() => Navigation.navigate(ROUTES.SEARCH_ADVANCED_FILTERS)}
/>
</HeaderWrapper>
);
}
Expand Down
11 changes: 8 additions & 3 deletions src/pages/Search/SearchStatusMenuNarrow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {useMemo, useRef, useState} from 'react';
import {Animated, View} from 'react-native';
import Button from '@components/Button';
import Icon from '@components/Icon';
import PopoverMenu from '@components/PopoverMenu';
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
Expand All @@ -10,6 +11,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import Navigation from '@libs/Navigation/Navigation';
import * as Expensicons from '@src/components/Icon/Expensicons';
import ROUTES from '@src/ROUTES';
import type {SearchStatusMenuItem} from './SearchStatusMenu';

type SearchStatusMenuNarrowProps = {
Expand Down Expand Up @@ -63,17 +65,16 @@ function SearchStatusMenuNarrow({statusMenuItems, activeItemIndex, title}: Searc
const titleViewStyles = title ? {...styles.flex1, ...styles.justifyContentCenter} : {};

return (
<View style={[styles.pb4, styles.flexRow, styles.alignItemsCenter, styles.justifyContentBetween]}>
<View style={[styles.pb4, styles.flexRow, styles.alignItemsCenter, styles.justifyContentBetween, styles.ph5, styles.gap2]}>
<PressableWithFeedback
accessible
accessibilityLabel={popoverMenuItems[activeItemIndex]?.text ?? ''}
ref={buttonRef}
style={[styles.tabSelectorButton, styles.ph5]}
wrapperStyle={styles.flex1}
onPress={openMenu}
>
{({hovered}) => (
<Animated.View style={[styles.tabSelectorButton, styles.tabBackground(hovered, true, theme.border), styles.w100, styles.mh3]}>
<Animated.View style={[styles.tabSelectorButton, styles.tabBackground(hovered, true, theme.border), styles.w100]}>
<View style={[styles.flexRow, styles.gap2, styles.alignItemsCenter, titleViewStyles]}>
<Icon
src={menuIcon}
Expand All @@ -93,6 +94,10 @@ function SearchStatusMenuNarrow({statusMenuItems, activeItemIndex, title}: Searc
</Animated.View>
)}
</PressableWithFeedback>
<Button
icon={Expensicons.Filters}
onPress={() => Navigation.navigate(ROUTES.SEARCH_ADVANCED_FILTERS)}
/>
<PopoverMenu
menuItems={popoverMenuItems}
isVisible={isPopoverVisible}
Expand Down

0 comments on commit a048f92

Please sign in to comment.