From 6c388cf4301dca3818ebd0e82692f9750f56f0e0 Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Thu, 14 Dec 2023 13:18:46 +0530 Subject: [PATCH] fixed lhn avatars --- src/components/AvatarWithDisplayName.tsx | 3 +-- src/components/LHNOptionsList/OptionRowLHN.js | 3 +-- src/components/OptionRow.js | 3 +-- src/libs/ReportUtils.ts | 2 +- src/styles/index.ts | 24 +++++++++---------- src/styles/utils/index.ts | 2 +- src/styles/variables.ts | 4 ++-- 7 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/components/AvatarWithDisplayName.tsx b/src/components/AvatarWithDisplayName.tsx index 5ea21502f2ca..b9bae33d7e23 100644 --- a/src/components/AvatarWithDisplayName.tsx +++ b/src/components/AvatarWithDisplayName.tsx @@ -65,7 +65,6 @@ function AvatarWithDisplayName({ const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(Object.values(ownerPersonalDetails), false); const shouldShowSubscriptAvatar = ReportUtils.shouldReportShowSubscript(report); const isExpenseRequest = ReportUtils.isExpenseRequest(report); - const defaultSubscriptSize = isExpenseRequest ? CONST.AVATAR_SIZE.SMALL_NORMAL : size; const avatarBorderColor = isAnonymous ? theme.highlightBG : theme.componentBG; const actorAccountID = useRef(null); @@ -118,7 +117,7 @@ function AvatarWithDisplayName({ backgroundColor={avatarBorderColor} mainAvatar={icons[0]} secondaryAvatar={icons[1]} - size={defaultSubscriptSize} + size={size} /> ) : ( ) : ( 1; - const defaultSubscriptSize = props.option.isExpenseRequest ? CONST.AVATAR_SIZE.SMALL_NORMAL : CONST.AVATAR_SIZE.DEFAULT; // We only create tooltips for the first 10 users or so since some reports have hundreds of users, causing performance to degrade. const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips( @@ -208,7 +207,7 @@ function OptionRow(props) { mainAvatar={props.option.icons[0]} secondaryAvatar={props.option.icons[1]} backgroundColor={hovered ? hoveredBackgroundColor : subscriptColor} - size={defaultSubscriptSize} + size={CONST.AVATAR_SIZE.DEFAULT} /> ) : ( ): boolean { - return isThread(report) && !isDM(report); + return isThread(report) && isChatReport(report) && !isDM(report); } /** diff --git a/src/styles/index.ts b/src/styles/index.ts index 9e02335bde0d..162622c93bc8 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -1963,14 +1963,14 @@ const styles = (theme: ThemeColors) => height: 24, width: 24, backgroundColor: theme.icon, - borderRadius: 24, + borderRadius: 12, }, singleAvatarSmall: { - height: 18, - width: 18, + height: 16, + width: 16, backgroundColor: theme.icon, - borderRadius: 18, + borderRadius: 8, }, singleAvatarMedium: { @@ -1984,17 +1984,17 @@ const styles = (theme: ThemeColors) => position: 'absolute', right: -18, bottom: -18, - borderWidth: 3, - borderRadius: 30, + borderWidth: 2, + borderRadius: 14, borderColor: 'transparent', }, secondAvatarSmall: { position: 'absolute', - right: -13, - bottom: -13, - borderWidth: 3, - borderRadius: 18, + right: -14, + bottom: -14, + borderWidth: 2, + borderRadius: 10, borderColor: 'transparent', }, @@ -2015,8 +2015,8 @@ const styles = (theme: ThemeColors) => secondAvatarSubscriptCompact: { position: 'absolute', - bottom: -1, - right: -1, + bottom: -4, + right: -4, }, secondAvatarSubscriptSmallNormal: { diff --git a/src/styles/utils/index.ts b/src/styles/utils/index.ts index c392e61f0814..91e8f5bcdf1a 100644 --- a/src/styles/utils/index.ts +++ b/src/styles/utils/index.ts @@ -118,7 +118,7 @@ const avatarFontSizes: Partial> = { const avatarBorderWidths: Partial> = { [CONST.AVATAR_SIZE.DEFAULT]: 3, - [CONST.AVATAR_SIZE.SMALL_SUBSCRIPT]: 1, + [CONST.AVATAR_SIZE.SMALL_SUBSCRIPT]: 2, [CONST.AVATAR_SIZE.MID_SUBSCRIPT]: 2, [CONST.AVATAR_SIZE.SUBSCRIPT]: 2, [CONST.AVATAR_SIZE.SMALL]: 2, diff --git a/src/styles/variables.ts b/src/styles/variables.ts index 65d7f6a0311d..f25c126310d9 100644 --- a/src/styles/variables.ts +++ b/src/styles/variables.ts @@ -39,9 +39,9 @@ export default { avatarSizeSmall: 28, avatarSizeSmaller: 24, avatarSizeSubscript: 20, - avatarSizeMidSubscript: 18, + avatarSizeMidSubscript: 16, avatarSizeMentionIcon: 16, - avatarSizeSmallSubscript: 14, + avatarSizeSmallSubscript: 12, defaultAvatarPreviewSize: 360, fabBottom: 25, fontSizeOnlyEmojis: 30,