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
2 changes: 2 additions & 0 deletions src/components/SelectionList/BaseListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function BaseListItem<TItem extends ListItem>({
item,
pressableStyle,
wrapperStyle,
containerStyle,
selectMultipleStyle,
isDisabled = false,
shouldPreventDefaultFocusOnSelectRow = false,
Expand Down Expand Up @@ -62,6 +63,7 @@ function BaseListItem<TItem extends ListItem>({
pendingAction={pendingAction}
errors={errors}
errorRowStyles={styles.ph5}
style={containerStyle}
>
<PressableWithFeedback
// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down
1 change: 1 addition & 0 deletions src/components/SelectionList/TableListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function TableListItem({
item={item}
pressableStyle={[[styles.selectionListPressableItemWrapper, item.isSelected && styles.activeComponentBG, isFocused && styles.sidebarLinkActive]]}
wrapperStyle={[styles.flexRow, styles.flex1, styles.justifyContentBetween, styles.userSelectNone, styles.alignItemsCenter]}
containerStyle={styles.mb3}
selectMultipleStyle={[StyleUtils.getCheckboxContainerStyle(20), StyleUtils.getMultiselectListStyles(!!item.isSelected, !!item.isDisabled)]}
isFocused={isFocused}
isDisabled={isDisabled}
Expand Down
3 changes: 3 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ type CommonListItemProps<TItem> = {
/** Styles for the wrapper view */
wrapperStyle?: StyleProp<ViewStyle>;

/** Styles for the container view */
containerStyle?: StyleProp<ViewStyle>;

/** Styles for the checkbox wrapper view if select multiple option is on */
selectMultipleStyle?: StyleProp<ViewStyle>;

Expand Down
35 changes: 18 additions & 17 deletions src/pages/workspace/WorkspacesListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,21 +182,22 @@ function WorkspacesListPage({policies, allPolicyMembers, reimbursementAccount, r
}

return (
<PressableWithoutFeedback
role={CONST.ROLE.BUTTON}
accessibilityLabel="row"
style={[styles.mh5, styles.mb3]}
disabled={item.disabled}
onPress={item.action}
<OfflineWithFeedback
key={`${item.title}_${index}`}
pendingAction={item.pendingAction}
errorRowStyles={styles.ph5}
onClose={item.dismissError}
errors={item.errors}
style={styles.mb3}
>
{({hovered}) => (
<OfflineWithFeedback
key={`${item.title}_${index}`}
pendingAction={item.pendingAction}
errorRowStyles={styles.ph5}
onClose={item.dismissError}
errors={item.errors}
>
<PressableWithoutFeedback
role={CONST.ROLE.BUTTON}
accessibilityLabel="row"
style={[styles.mh5]}
disabled={item.disabled}
onPress={item.action}
>
{({hovered}) => (
<WorkspacesListRow
title={item.title}
menuItems={threeDotsMenuItems}
Expand All @@ -209,9 +210,9 @@ function WorkspacesListPage({policies, allPolicyMembers, reimbursementAccount, r
brickRoadIndicator={item.brickRoadIndicator}
shouldDisableThreeDotsMenu={item.disabled}
/>
</OfflineWithFeedback>
)}
</PressableWithoutFeedback>
)}
</PressableWithoutFeedback>
</OfflineWithFeedback>
);
},
[isLessThanMediumScreen, styles.mb3, styles.mh5, styles.ph5, styles.hoveredComponentBG, translate],
Expand Down
1 change: 0 additions & 1 deletion src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4307,7 +4307,6 @@ const styles = (theme: ThemeColors) =>
paddingHorizontal: 16,
paddingVertical: 16,
marginHorizontal: 20,
marginBottom: 12,
backgroundColor: theme.highlightBG,
borderRadius: 8,
},
Expand Down