Skip to content

Commit

Permalink
feat: use correct filter icon and adjust the popup position for web a…
Browse files Browse the repository at this point in the history
…nd desktop
  • Loading branch information
hurali97 committed Jul 26, 2024
1 parent 46c3f78 commit 50fb3dc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
11 changes: 11 additions & 0 deletions assets/images/filter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/HeaderWithBackButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ function HeaderWithBackButton({
horizontal: 0,
},
threeDotsMenuItems = [],
threeDotsMenuIcon,
threeDotsMenuIconFill,
shouldEnableDetailPageNavigation = false,
children = null,
shouldOverlayDots = false,
Expand Down Expand Up @@ -234,6 +236,8 @@ function HeaderWithBackButton({
{shouldShowPinButton && !!report && <PinButton report={report} />}
{shouldShowThreeDotsButton && (
<ThreeDotsMenu
icon={threeDotsMenuIcon}
iconFill={threeDotsMenuIconFill}
disabled={shouldDisableThreeDotsButton}
menuItems={threeDotsMenuItems}
onIconPress={onThreeDotsButtonPress}
Expand Down
6 changes: 6 additions & 0 deletions src/components/HeaderWithBackButton/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ type HeaderWithBackButtonProps = Partial<ChildrenProps> & {
/** The anchor position of the menu */
threeDotsAnchorPosition?: AnchorPosition;

/** Icon displayed on the right of the title */
threeDotsMenuIcon?: IconAsset;

/** The fill color to pass into the icon. */
threeDotsMenuIconFill?: string;

/** Whether we should show a close button */
shouldShowCloseButton?: boolean;

Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Expensicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ import ExpensifyLogoNew from '@assets/images/expensify-logo-new.svg';
import ExpensifyWordmark from '@assets/images/expensify-wordmark.svg';
import EyeDisabled from '@assets/images/eye-disabled.svg';
import Eye from '@assets/images/eye.svg';
import Filter from '@assets/images/filter.svg';
import Flag from '@assets/images/flag.svg';
import FlagLevelOne from '@assets/images/flag_level_01.svg';
import FlagLevelTwo from '@assets/images/flag_level_02.svg';
Expand Down Expand Up @@ -372,4 +373,5 @@ export {
CheckCircle,
CheckmarkCircle,
NetSuiteSquare,
Filter,
};
6 changes: 5 additions & 1 deletion src/pages/settings/AboutPage/ConsolePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
import useLocalize from '@hooks/useLocalize';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import {addLog} from '@libs/actions/Console';
import {createLog, parseStringifiedMessages, sanitizeConsoleInput} from '@libs/Console';
import type {Log} from '@libs/Console';
Expand Down Expand Up @@ -56,7 +57,7 @@ function ConsolePage({capturedLogs, shouldStoreLogs}: ConsolePageProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const theme = useTheme();

const {windowWidth} = useWindowDimensions();
const route = useRoute<RouteProp<SettingsNavigatorParamList, typeof SCREENS.SETTINGS.CONSOLE>>();

const menuItems: PopoverMenuItem[] = useMemo(
Expand Down Expand Up @@ -164,6 +165,9 @@ function ConsolePage({capturedLogs, shouldStoreLogs}: ConsolePageProps) {
onBackButtonPress={() => Navigation.goBack(route.params?.backTo)}
shouldShowThreeDotsButton
threeDotsMenuItems={menuItems}
threeDotsAnchorPosition={styles.threeDotsPopoverOffset(windowWidth)}
threeDotsMenuIcon={Expensicons.Filter}
threeDotsMenuIconFill={theme.icon}
/>
<View style={[styles.border, styles.highlightBG, styles.borderNone, styles.mh5, styles.flex1]}>
<InvertedFlatList
Expand Down

0 comments on commit 50fb3dc

Please sign in to comment.