Skip to content
Merged
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
10 changes: 8 additions & 2 deletions src/components/SelectionList/ListItem/UserListItemContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {ListItemFocusContext} from '@components/SelectionList/ListItemFocusConte
import getAccessibilityLabel from '@components/SelectionList/utils/getAccessibilityLabel';
import TextWithTooltip from '@components/TextWithTooltip';
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useStyleUtils from '@hooks/useStyleUtils';
import useTheme from '@hooks/useTheme';
Expand Down Expand Up @@ -53,6 +54,7 @@ function UserListItemContent<TItem extends ListItem>({
const styles = useThemeStyles();
const theme = useTheme();
const StyleUtils = useStyleUtils();
const {translate} = useLocalize();

const focusedBackgroundColor = styles.sidebarLinkActive.backgroundColor;
const subscriptAvatarBorderColor = isFocused ? focusedBackgroundColor : theme.sidebar;
Expand All @@ -72,12 +74,16 @@ function UserListItemContent<TItem extends ListItem>({
const policyID = isThereOnlyWorkspaceIcon && shouldUseIconPolicyID ? String(item.icons?.at(0)?.id) : item.policyID;

const isHovered = hovered && !shouldDisableHoverStyle;
const contactAccessibilityLabel = getAccessibilityLabel(item);
const baseAccessibilityLabel = getAccessibilityLabel(item);
const accessibilityLabel =
shouldDisableAccessibleGrouping && item.isSelected !== undefined
? `${translate(item.isSelected ? 'common.deselect' : 'common.select')}, ${baseAccessibilityLabel}`
: baseAccessibilityLabel;

return (
<View
accessible={shouldDisableAccessibleGrouping || undefined}
accessibilityLabel={shouldDisableAccessibleGrouping ? contactAccessibilityLabel : undefined}
accessibilityLabel={shouldDisableAccessibleGrouping ? accessibilityLabel : undefined}
role={shouldDisableAccessibleGrouping ? CONST.ROLE.BUTTON : undefined}
style={[styles.flex1, styles.flexRow, styles.alignItemsCenter]}
>
Expand Down
Loading