Skip to content

Commit

Permalink
Merge pull request Expensify#51495 from ChavdaSachin/fix-51457
Browse files Browse the repository at this point in the history
Fix header on ReportFieldsListValuePage
  • Loading branch information
MarioExpensify authored Oct 28, 2024
2 parents 3383125 + 0f006bf commit 9f97734
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 33 deletions.
24 changes: 7 additions & 17 deletions src/pages/workspace/reportFields/ReportFieldsListValuesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ListItemRightCaretWithLabel from '@components/SelectionList/ListItemRight
import TableListItem from '@components/SelectionList/TableListItem';
import type {ListItem} from '@components/SelectionList/types';
import SelectionListWithModal from '@components/SelectionListWithModal';
import CustomListHeader from '@components/SelectionListWithModal/CustomListHeader';
import TableListItemSkeleton from '@components/Skeletons/TableRowSkeleton';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
Expand Down Expand Up @@ -153,24 +154,13 @@ function ReportFieldsListValuesPage({
};

const getCustomListHeader = () => {
const header = (
<View
style={[
styles.flex1,
styles.flexRow,
styles.justifyContentBetween,
// Required padding accounting for the checkbox in multi-select mode
canSelectMultiple && styles.pl3,
]}
>
<Text style={styles.searchInputStyle}>{translate('common.name')}</Text>
<Text style={[styles.searchInputStyle, styles.textAlignCenter]}>{translate('statusPage.status')}</Text>
</View>
return (
<CustomListHeader
canSelectMultiple={canSelectMultiple}
leftHeaderText={translate('common.name')}
rightHeaderText={translate('statusPage.status')}
/>
);
if (canSelectMultiple) {
return header;
}
return <View style={[styles.flexRow, styles.ph9, styles.pv3, styles.pb5]}>{header}</View>;
};

const getHeaderButtons = () => {
Expand Down
23 changes: 7 additions & 16 deletions src/pages/workspace/tags/WorkspaceViewTagsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ import ScreenWrapper from '@components/ScreenWrapper';
import ListItemRightCaretWithLabel from '@components/SelectionList/ListItemRightCaretWithLabel';
import TableListItem from '@components/SelectionList/TableListItem';
import SelectionListWithModal from '@components/SelectionListWithModal';
import Text from '@components/Text';
import CustomListHeader from '@components/SelectionListWithModal/CustomListHeader';
import useLocalize from '@hooks/useLocalize';
import useMobileSelectionMode from '@hooks/useMobileSelectionMode';
import useNetwork from '@hooks/useNetwork';
import usePolicy from '@hooks/usePolicy';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useStyleUtils from '@hooks/useStyleUtils';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import {turnOffMobileSelectionMode} from '@libs/actions/MobileSelectionMode';
Expand All @@ -47,7 +46,6 @@ function WorkspaceViewTagsPage({route}: WorkspaceViewTagsProps) {
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
const {shouldUseNarrowLayout, isSmallScreenWidth} = useResponsiveLayout();
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const theme = useTheme();
const {translate} = useLocalize();
const [selectedTags, setSelectedTags] = useState<Record<string, boolean>>({});
Expand Down Expand Up @@ -128,20 +126,13 @@ function WorkspaceViewTagsPage({route}: WorkspaceViewTagsProps) {
};

const getCustomListHeader = () => {
const header = (
<View style={[styles.flex1, styles.flexRow, styles.justifyContentBetween, canSelectMultiple && styles.ml3]}>
<View>
<Text style={[styles.searchInputStyle]}>{translate('common.name')}</Text>
</View>
<View style={[StyleUtils.getMinimumWidth(60)]}>
<Text style={[styles.searchInputStyle, styles.textAlignCenter]}>{translate('statusPage.status')}</Text>
</View>
</View>
return (
<CustomListHeader
canSelectMultiple={canSelectMultiple}
leftHeaderText={translate('common.name')}
rightHeaderText={translate('statusPage.status')}
/>
);
if (canSelectMultiple) {
return header;
}
return <View style={[styles.peopleRow, styles.userSelectNone, styles.ph9, styles.pt3, styles.pb5]}>{header}</View>;
};

const navigateToTagSettings = (tag: TagListItem) => {
Expand Down

0 comments on commit 9f97734

Please sign in to comment.