diff --git a/src/components/SelectionList/BaseListItem.tsx b/src/components/SelectionList/BaseListItem.tsx index 71845931ba52..0290d7bfda98 100644 --- a/src/components/SelectionList/BaseListItem.tsx +++ b/src/components/SelectionList/BaseListItem.tsx @@ -63,77 +63,83 @@ function BaseListItem({ onMouseDown={shouldPreventDefaultFocusOnSelectRow ? (e) => e.preventDefault() : undefined} nativeID={keyForList} > - - {canSelectMultiple && ( + {({hovered}) => ( + <> - - {item.isSelected && ( - - )} - - - )} + {canSelectMultiple && ( + + + {item.isSelected && ( + + )} + + + )} - onSelectRow(item)} - showTooltip={showTooltip} - /> + onSelectRow(item)} + showTooltip={showTooltip} + isFocused={isFocused} + isHovered={hovered} + /> - {!canSelectMultiple && item.isSelected && !rightHandSideComponent && ( - - - - + {!canSelectMultiple && item.isSelected && !rightHandSideComponent && ( + + + + + + )} + {rightHandSideComponentRender()} - )} - {rightHandSideComponentRender()} - - {isUserItem && item.invitedSecondaryLogin && ( - - {translate('workspace.people.invitedBySecondaryLogin', {secondaryLogin: item.invitedSecondaryLogin})} - + {isUserItem && item.invitedSecondaryLogin && ( + + {translate('workspace.people.invitedBySecondaryLogin', {secondaryLogin: item.invitedSecondaryLogin})} + + )} + )} diff --git a/src/components/SelectionList/UserListItem.tsx b/src/components/SelectionList/UserListItem.tsx index fede09c1b435..f48f9e04077a 100644 --- a/src/components/SelectionList/UserListItem.tsx +++ b/src/components/SelectionList/UserListItem.tsx @@ -1,20 +1,45 @@ import React from 'react'; import {View} from 'react-native'; +import MultipleAvatars from '@components/MultipleAvatars'; import SubscriptAvatar from '@components/SubscriptAvatar'; import TextWithTooltip from '@components/TextWithTooltip'; +import useStyleUtils from '@hooks/useStyleUtils'; +import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import type {UserListItemProps} from './types'; -function UserListItem({item, textStyles, alternateTextStyles, showTooltip, style}: UserListItemProps) { +function UserListItem({item, textStyles, alternateTextStyles, showTooltip, style, isFocused, isHovered}: UserListItemProps) { const styles = useThemeStyles(); + const theme = useTheme(); + const StyleUtils = useStyleUtils(); + + const focusedBackgroundColor = styles.sidebarLinkActive.backgroundColor; + const subscriptAvatarBorderColor = isFocused ? focusedBackgroundColor : theme.sidebar; + const hoveredBackgroundColor = !!styles.sidebarLinkHover && 'backgroundColor' in styles.sidebarLinkHover ? styles.sidebarLinkHover.backgroundColor : theme.sidebar; + return ( <> {!!item.icons && ( - + <> + {item.shouldShowSubscript ? ( + + ) : ( + + )} + )} & { @@ -81,6 +84,9 @@ type UserListItemProps = CommonListItemProps & { /** Additional styles to apply to text */ style?: StyleProp; + + /** Is item hovered */ + isHovered?: boolean; }; type RadioItem = {