Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rbr for reports in filter page #49199

Merged
merged 3 commits into from
Sep 17, 2024
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
3 changes: 2 additions & 1 deletion src/components/SelectionList/BaseListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function BaseListItem<TItem extends ListItem>({
children,
isFocused,
shouldSyncFocus = true,
shouldDisplayRBR = true,
onFocus = () => {},
hoverStyle,
onLongPressRow,
Expand Down Expand Up @@ -115,7 +116,7 @@ function BaseListItem<TItem extends ListItem>({
</View>
</View>
)}
{!item.isSelected && !!item.brickRoadIndicator && (
{!item.isSelected && !!item.brickRoadIndicator && shouldDisplayRBR && (
<View style={[styles.alignItemsCenter, styles.justifyContentCenter]}>
<Icon
src={Expensicons.DotIndicator}
Expand Down
5 changes: 4 additions & 1 deletion src/components/SelectionList/InviteMemberListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ function InviteMemberListItem<TItem extends ListItem>({
const subscriptAvatarBorderColor = isFocused ? focusedBackgroundColor : theme.sidebar;
const hoveredBackgroundColor = !!styles.sidebarLinkHover && 'backgroundColor' in styles.sidebarLinkHover ? styles.sidebarLinkHover.backgroundColor : theme.sidebar;

const shouldShowCheckBox = canSelectMultiple && !item.isDisabled;

const handleCheckboxPress = useCallback(() => {
if (onCheckboxPress) {
onCheckboxPress(item);
Expand Down Expand Up @@ -68,6 +70,7 @@ function InviteMemberListItem<TItem extends ListItem>({
keyForList={item.keyForList}
onFocus={onFocus}
shouldSyncFocus={shouldSyncFocus}
shouldDisplayRBR={!shouldShowCheckBox}
>
{(hovered?: boolean) => (
<>
Expand Down Expand Up @@ -113,7 +116,7 @@ function InviteMemberListItem<TItem extends ListItem>({
)}
</View>
{!!item.rightElement && item.rightElement}
{canSelectMultiple && !item.isDisabled && (
{shouldShowCheckBox && (
<PressableWithFeedback
onPress={handleCheckboxPress}
disabled={isDisabled}
Expand Down
4 changes: 4 additions & 0 deletions src/components/SelectionList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ type ListItemProps<TItem extends ListItem> = CommonListItemProps<TItem> & {
* When we type something into the text input, the first element found is focused, in this situation we should not synchronize the focus on the element because we will lose the focus from the text input.
*/
shouldSyncFocus?: boolean;

/** Whether to show RBR */
shouldDisplayRBR?: boolean;
};

type BaseListItemProps<TItem extends ListItem> = CommonListItemProps<TItem> & {
Expand All @@ -273,6 +276,7 @@ type BaseListItemProps<TItem extends ListItem> = CommonListItemProps<TItem> & {
children?: ReactElement<ListItemProps<TItem>> | ((hovered: boolean) => ReactElement<ListItemProps<TItem>>);
shouldSyncFocus?: boolean;
hoverStyle?: StyleProp<ViewStyle>;
shouldDisplayRBR?: boolean;
};

type UserListItemProps<TItem extends ListItem> = ListItemProps<TItem> & {
Expand Down
Loading