Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ function ExpenseReportListItem<TItem extends ListItem>({
shouldHighlight: item?.shouldAnimateInHighlight ?? false,
highlightColor: theme.messageHighlightBG,
backgroundColor: theme.highlightBG,
shouldApplyOtherStyles: !isLargeScreenWidth,
});

const shouldShowViolationDescription = isOpenExpenseReport(reportItem) || isProcessingReport(reportItem);
Expand Down Expand Up @@ -265,7 +266,12 @@ function ExpenseReportListItem<TItem extends ListItem>({
onLongPressRow={onLongPressRow}
shouldSyncFocus={shouldSyncFocus}
hoverStyle={item.isSelected && styles.activeComponentBG}
pressableWrapperStyle={[styles.mh5, animatedHighlightStyle, isPendingDelete && styles.cursorDisabled, isLargeScreenWidth && isLastItem && styles.searchTableBottomRadius]}
pressableWrapperStyle={[
styles.mh5,
animatedHighlightStyle,
isPendingDelete && styles.cursorDisabled,
isLargeScreenWidth && isLastItem && [styles.searchTableBottomRadius, styles.overflowHidden],
]}
accessible={false}
shouldShowRightCaret={false}
shouldUseDefaultRightHandSideCheckmark={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function TaskListItem<TItem extends ListItem>({
shouldHighlight: item?.shouldAnimateInHighlight ?? false,
highlightColor: theme.messageHighlightBG,
backgroundColor: theme.highlightBG,
shouldApplyOtherStyles: !isLargeScreenWidth,
});

const fsClass = FS.getChatFSClass(parentReport);
Expand All @@ -76,7 +77,7 @@ function TaskListItem<TItem extends ListItem>({
onLongPressRow={onLongPressRow}
shouldSyncFocus={shouldSyncFocus}
hoverStyle={item.isSelected && styles.activeComponentBG}
pressableWrapperStyle={[styles.mh5, animatedHighlightStyle, isLargeScreenWidth && isLastItem && styles.searchTableBottomRadius]}
pressableWrapperStyle={[styles.mh5, animatedHighlightStyle, isLargeScreenWidth && isLastItem && [styles.searchTableBottomRadius, styles.overflowHidden]]}
forwardedFSClass={fsClass}
>
<TaskListItemRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ function TaskListItemRow({item, containerStyle, showTooltip}: TaskListItemRowPro
isLargeScreenWidth={isLargeScreenWidth}
/>
</View>
<View style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ACTION)]}>
<View style={[StyleUtils.getReportTableColumnStyles(CONST.SEARCH.TABLE_COLUMNS.ACTION, {isActionColumnWide: true})]}>
<ActionCell
taskItem={item}
showTooltip={showTooltip}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function TransactionGroupListItem<TItem extends ListItem>({
shouldHighlight: item?.shouldAnimateInHighlight ?? false,
highlightColor: theme.messageHighlightBG,
backgroundColor: theme.highlightBG,
shouldApplyOtherStyles: !isLargeScreenWidth,
});

const isItemSelected = isSelectAllChecked || item?.isSelected;
Expand Down Expand Up @@ -534,6 +535,7 @@ function TransactionGroupListItem<TItem extends ListItem>({
animatedHighlightStyle,
styles.userSelectNone,
isLargeScreenWidth && StyleUtils.getSearchTableGroupRowBorderStyle(isFirstItem, isLastItem, isItemSelected),
isLargeScreenWidth && isLastItem && styles.overflowHidden,
]}
>
{({hovered}) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ function TransactionListItem<TItem extends ListItem>({
shouldHighlight: item?.shouldAnimateInHighlight ?? false,
highlightColor: theme.messageHighlightBG,
backgroundColor: theme.highlightBG,
shouldApplyOtherStyles: !isLargeScreenWidth,
});

const amountColumnSize = transactionItem.isAmountColumnWide ? CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE : CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL;
Expand Down Expand Up @@ -211,7 +212,7 @@ function TransactionListItem<TItem extends ListItem>({
styles.flex1,
animatedHighlightStyle,
styles.userSelectNone,
isLargeScreenWidth && isLastItem && styles.searchTableBottomRadius,
isLargeScreenWidth && isLastItem && [styles.searchTableBottomRadius, styles.overflowHidden],
]}
>
{({hovered}) => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/SearchList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ function SearchList({
}, [data, groupBy, newTransactions]);

const {windowWidth} = useWindowDimensions();
const minTableWidth = getTableMinWidth(columns);
const minTableWidth = getTableMinWidth(columns, queryJSON.type);
const shouldScrollHorizontally = !!SearchTableHeader && minTableWidth > windowWidth;

const horizontalScrollViewRef = useRef<RNScrollView>(null);
Expand Down
1 change: 1 addition & 0 deletions src/components/Search/SearchTableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ function SearchTableHeader({
sortBy={sortBy}
sortOrder={sortOrder}
shouldRemoveTotalColumnFlex={!!groupBy !== !!isExpenseReportView}
isActionColumnWide={type === CONST.SEARCH.DATA_TYPES.TASK}
// Don't butt up against the 'select all' checkbox if present
containerStyles={canSelectMultiple && [styles.pl3]}
onSortPress={(columnName, order) => {
Expand Down
3 changes: 3 additions & 0 deletions src/components/Search/SortableTableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type SearchTableHeaderProps = {
shouldShowColumn: (columnName: SearchColumnType) => boolean;
onSortPress: (column: SearchColumnType, order: SortOrder) => void;
shouldRemoveTotalColumnFlex?: boolean;
isActionColumnWide?: boolean;
};

function SortableTableHeader({
Expand All @@ -54,6 +55,7 @@ function SortableTableHeader({
amountColumnSize,
taxAmountColumnSize,
shouldRemoveTotalColumnFlex,
isActionColumnWide,
}: SearchTableHeaderProps) {
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
Expand Down Expand Up @@ -91,6 +93,7 @@ function SortableTableHeader({
isAmountColumnWide: amountColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE,
shouldRemoveTotalColumnFlex,
isWithdrawnColumnWide: withdrawnColumnSize === CONST.SEARCH.TABLE_COLUMN_SIZES.WIDE,
isActionColumnWide,
}),
]}
isSortable={isSortable}
Expand Down
4 changes: 2 additions & 2 deletions src/libs/SearchUIUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5130,7 +5130,7 @@ function getTransactionFromTransactionListItem(item: TransactionListItemType): O
return transaction as OnyxTypes.Transaction;
}

function getTableMinWidth(columns: SearchColumnType[]) {
function getTableMinWidth(columns: SearchColumnType[], type?: SearchDataTypes) {
// Starts at 24px to account for the checkbox width
let minWidth = 24;

Expand All @@ -5144,7 +5144,7 @@ function getTableMinWidth(columns: SearchColumnType[]) {
} else if (column === CONST.SEARCH.TABLE_COLUMNS.STATUS) {
minWidth += 80;
} else if (column === CONST.SEARCH.TABLE_COLUMNS.ACTION) {
minWidth += 68;
minWidth += type === CONST.SEARCH.DATA_TYPES.TASK ? 80 : 68;
} else if (column === CONST.SEARCH.TABLE_COLUMNS.DATE) {
minWidth += 48;
} else if (
Expand Down
4 changes: 3 additions & 1 deletion src/styles/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type GetReportTableColumnStylesParams = {
isExportedColumnWide?: boolean;
shouldRemoveTotalColumnFlex?: boolean;
isWithdrawnColumnWide?: boolean;
isActionColumnWide?: boolean;
};

const workspaceColorOptions: SVGAvatarColorStyle[] = LETTER_AVATAR_COLOR_OPTIONS.map(({backgroundColor, fillColor}) => ({backgroundColor, fill: fillColor}));
Expand Down Expand Up @@ -1842,6 +1843,7 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({
isAmountColumnWide,
shouldRemoveTotalColumnFlex,
isWithdrawnColumnWide,
isActionColumnWide,
} = options;

let columnWidth;
Expand Down Expand Up @@ -1917,7 +1919,7 @@ const createStyleUtils = (theme: ThemeColors, styles: ThemeStyles) => ({
columnWidth = {...getWidthStyle(variables.w92), ...styles.flex1};
break;
case CONST.SEARCH.TABLE_COLUMNS.ACTION:
columnWidth = {...getWidthStyle(variables.w68), ...styles.alignItemsCenter};
columnWidth = {...getWidthStyle(isActionColumnWide ? variables.w80 : variables.w68), ...styles.alignItemsCenter};
Comment thread
Krishna2323 marked this conversation as resolved.
break;
case CONST.SEARCH.TABLE_COLUMNS.EXPORTED_TO:
columnWidth = {...getWidthStyle(variables.w72), ...styles.alignItemsCenter};
Expand Down
Loading