Skip to content

Commit 155818e

Browse files
committed
update perdiem column ratio
1 parent 7b54f74 commit 155818e

File tree

6 files changed

+20
-6
lines changed

6 files changed

+20
-6
lines changed

src/components/SelectionList/BaseSelectionList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ function BaseSelectionList<TItem extends ListItem>(
120120
onContentSizeChange,
121121
listItemTitleStyles,
122122
initialNumToRender = 12,
123+
listItemTitleContainerStyles,
123124
}: BaseSelectionListProps<TItem>,
124125
ref: ForwardedRef<SelectionListHandle>,
125126
) {
@@ -549,6 +550,7 @@ function BaseSelectionList<TItem extends ListItem>(
549550
titleStyles={listItemTitleStyles}
550551
shouldHighlightSelectedItem={shouldHighlightSelectedItem}
551552
singleExecution={singleExecution}
553+
titleContainerStyles={listItemTitleContainerStyles}
552554
/>
553555
</View>
554556
);

src/components/SelectionList/BaseSelectionListItemRenderer.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import type {StyleProp, TextStyle} from 'react-native';
2+
import type {StyleProp, TextStyle, ViewStyle} from 'react-native';
33
import type useArrowKeyFocusManager from '@hooks/useArrowKeyFocusManager';
44
import type useSingleExecution from '@hooks/useSingleExecution';
55
import * as SearchUIUtils from '@libs/SearchUIUtils';
@@ -13,6 +13,7 @@ type BaseSelectionListItemRendererProps<TItem extends ListItem> = Omit<BaseListI
1313
normalizedIndex: number;
1414
singleExecution: ReturnType<typeof useSingleExecution>['singleExecution'];
1515
titleStyles?: StyleProp<TextStyle>;
16+
titleContainerStyles?: StyleProp<ViewStyle>;
1617
};
1718

1819
function BaseSelectionListItemRenderer<TItem extends ListItem>({
@@ -41,6 +42,7 @@ function BaseSelectionListItemRenderer<TItem extends ListItem>({
4142
wrapperStyle,
4243
titleStyles,
4344
singleExecution,
45+
titleContainerStyles,
4446
}: BaseSelectionListItemRendererProps<TItem>) {
4547
const handleOnCheckboxPress = () => {
4648
if (SearchUIUtils.isReportListItemType(item)) {
@@ -86,6 +88,7 @@ function BaseSelectionListItemRenderer<TItem extends ListItem>({
8688
shouldHighlightSelectedItem={shouldHighlightSelectedItem}
8789
wrapperStyle={wrapperStyle}
8890
titleStyles={titleStyles}
91+
titleContainerStyles={titleContainerStyles}
8992
/>
9093
{item.footerContent && item.footerContent}
9194
</>

src/components/SelectionList/TableListItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function TableListItem<TItem extends ListItem>({
2626
onFocus,
2727
onLongPressRow,
2828
shouldSyncFocus,
29+
titleContainerStyles,
2930
}: TableListItemProps<TItem>) {
3031
const styles = useThemeStyles();
3132
const theme = useTheme();
@@ -115,7 +116,7 @@ function TableListItem<TItem extends ListItem>({
115116
]}
116117
/>
117118
)}
118-
<View style={[styles.flex1, styles.flexColumn, styles.justifyContentCenter, styles.alignItemsStretch]}>
119+
<View style={[styles.flex1, styles.flexColumn, styles.justifyContentCenter, styles.alignItemsStretch, titleContainerStyles]}>
119120
<TextWithTooltip
120121
shouldShowTooltip={showTooltip}
121122
text={item.text ?? ''}

src/components/SelectionList/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ type ListItemProps<TItem extends ListItem> = CommonListItemProps<TItem> & {
300300

301301
/** Styles applied for the title */
302302
titleStyles?: StyleProp<TextStyle>;
303+
304+
/** Styles applid for the title container of the list item */
305+
titleContainerStyles?: StyleProp<ViewStyle>;
303306
};
304307

305308
type BaseListItemProps<TItem extends ListItem> = CommonListItemProps<TItem> & {
@@ -569,6 +572,9 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
569572
/** Styles applid for the title of the list item */
570573
listItemTitleStyles?: StyleProp<TextStyle>;
571574

575+
/** Styles applid for the title container of the list item */
576+
listItemTitleContainerStyles?: StyleProp<ViewStyle>;
577+
572578
/** This may improve scroll performance for large lists */
573579
removeClippedSubviews?: boolean;
574580

src/libs/Permissions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as SessionUtils from './SessionUtils';
66
const isAccountIDEven = (accountID: number) => accountID % 2 === 0;
77

88
function canUseAllBetas(betas: OnyxEntry<Beta[]>): boolean {
9+
return true;
910
return !!betas?.includes(CONST.BETAS.ALL);
1011
}
1112

src/pages/workspace/perDiem/WorkspacePerDiemPage.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function WorkspacePerDiemPage({route}: WorkspacePerDiemPageProps) {
170170
pendingAction: value.pendingAction,
171171
rightElement: (
172172
<>
173-
<View style={styles.flex1}>
173+
<View style={styles.flex3}>
174174
<Text style={[styles.alignItemsStart, styles.textSupporting, styles.label, styles.pl2]}>{value.subRateName}</Text>
175175
</View>
176176
<View style={styles.flex1}>
@@ -182,7 +182,7 @@ function WorkspacePerDiemPage({route}: WorkspacePerDiemPageProps) {
182182
),
183183
};
184184
}),
185-
[allSubRates, selectedPerDiem, canSelectMultiple, styles.flex1, styles.alignItemsStart, styles.textSupporting, styles.label, styles.alignSelfEnd, styles.pl2],
185+
[allSubRates, selectedPerDiem, canSelectMultiple, styles.flex3, styles.alignItemsStart, styles.textSupporting, styles.label, styles.pl2, styles.flex1, styles.alignSelfEnd],
186186
);
187187

188188
const toggleSubRate = (subRate: PolicyOption) => {
@@ -207,10 +207,10 @@ function WorkspacePerDiemPage({route}: WorkspacePerDiemPageProps) {
207207

208208
const getCustomListHeader = () => (
209209
<View style={[styles.flex1, styles.flexRow, styles.justifyContentBetween, canSelectMultiple && styles.pl3, !canSelectMultiple && [styles.ph9, styles.pv3, styles.pb5]]}>
210-
<View style={styles.flex1}>
210+
<View style={styles.flex3}>
211211
<Text style={[styles.searchInputStyle, styles.alignSelfStart]}>{translate('common.destination')}</Text>
212212
</View>
213-
<View style={styles.flex1}>
213+
<View style={styles.flex3}>
214214
<Text style={[styles.searchInputStyle, styles.alignItemsStart, styles.pl2]}>{translate('common.subrate')}</Text>
215215
</View>
216216
<View style={styles.flex1}>
@@ -421,6 +421,7 @@ function WorkspacePerDiemPage({route}: WorkspacePerDiemPageProps) {
421421
customListHeader={getCustomListHeader()}
422422
listHeaderWrapperStyle={[styles.ph9, styles.pv3, styles.pb5]}
423423
listHeaderContent={shouldUseNarrowLayout ? getHeaderText() : null}
424+
listItemTitleContainerStyles={styles.flex3}
424425
showScrollIndicator={false}
425426
/>
426427
)}

0 commit comments

Comments
 (0)