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
24 changes: 10 additions & 14 deletions src/components/MultipleAvatars.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,17 @@ function MultipleAvatars(props) {
avatar: icon.avatar,
}}
>
<View
style={[
styles.justifyContentCenter,
styles.alignItemsCenter,
StyleUtils.getHorizontalStackedAvatarBorderStyle({
isHovered: props.isHovered,
isPressed: props.isPressed,
isInReportAction: props.isInReportAction,
shouldUseCardBackground: props.shouldUseCardBackground,
}),
StyleUtils.getHorizontalStackedAvatarStyle(index, overlapSize, oneAvatarBorderWidth, oneAvatarSize.width),
icon.type === CONST.ICON_TYPE_WORKSPACE ? StyleUtils.getAvatarBorderRadius(props.size, icon.type) : {},
]}
>
<View style={[StyleUtils.getHorizontalStackedAvatarStyle(index, overlapSize), StyleUtils.getAvatarBorderRadius(props.size, icon.type)]}>
<Avatar
iconAdditionalStyles={[
StyleUtils.getHorizontalStackedAvatarBorderStyle({
isHovered: props.isHovered,
isPressed: props.isPressed,
isInReportAction: props.isInReportAction,
shouldUseCardBackground: props.shouldUseCardBackground,
}),
StyleUtils.getAvatarBorderWidth(props.size),
]}
source={icon.source || props.fallbackIcon}
fill={themeColors.iconSuccessFill}
size={props.size}
Expand Down
15 changes: 5 additions & 10 deletions src/styles/StyleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,20 +878,17 @@ function getKeyboardShortcutsModalWidth(isSmallScreenWidth) {
* @returns {Object}
*/
function getHorizontalStackedAvatarBorderStyle({isHovered, isPressed, isInReportAction = false, shouldUseCardBackground = false}) {
let backgroundColor = shouldUseCardBackground ? themeColors.cardBG : themeColors.appBG;
let borderColor = shouldUseCardBackground ? themeColors.cardBG : themeColors.appBG;

if (isHovered) {
backgroundColor = isInReportAction ? themeColors.highlightBG : themeColors.border;
borderColor = isInReportAction ? themeColors.highlightBG : themeColors.border;
}

if (isPressed) {
backgroundColor = isInReportAction ? themeColors.highlightBG : themeColors.buttonPressedBG;
borderColor = isInReportAction ? themeColors.highlightBG : themeColors.buttonPressedBG;
}

return {
backgroundColor,
borderColor: backgroundColor,
};
return {borderColor};
}

/**
Expand All @@ -902,11 +899,9 @@ function getHorizontalStackedAvatarBorderStyle({isHovered, isPressed, isInReport
* @param {Number} borderRadius
* @returns {Object}
*/
function getHorizontalStackedAvatarStyle(index, overlapSize, borderWidth, borderRadius) {
function getHorizontalStackedAvatarStyle(index, overlapSize) {
return {
marginLeft: index > 0 ? -overlapSize : 0,
borderRadius,
borderWidth,
zIndex: index + 2,
};
}
Expand Down