Skip to content

Commit 8a3d487

Browse files
committed
Change size of the avatars in details page
1 parent dad65f7 commit 8a3d487

6 files changed

Lines changed: 22 additions & 15 deletions

File tree

src/CONST/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3131,6 +3131,7 @@ const CONST = {
31313131
SMALL_SUBSCRIPT: 'small-subscript',
31323132
MID_SUBSCRIPT: 'mid-subscript',
31333133
LARGE_BORDERED: 'large-bordered',
3134+
MEDIUM_LARGE: 'medium-large',
31343135
HEADER: 'header',
31353136
MENTION_ICON: 'mention-icon',
31363137
SMALL_NORMAL: 'small-normal',

src/components/ReportActionAvatars/ReportActionAvatar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ function ReportActionAvatarMultipleDiagonal({
418418
const StyleUtils = useStyleUtils();
419419

420420
const tooltipTexts = useMemo(() => (shouldShowTooltip ? icons.map((icon) => getUserDetailTooltipText(Number(icon.id), icon.name)) : ['']), [shouldShowTooltip, icons]);
421-
const useHugeBottomMargin = icons.length === 2 && size === CONST.AVATAR_SIZE.X_LARGE;
421+
const removeRightMargin = icons.length === 2 && size === CONST.AVATAR_SIZE.X_LARGE;
422422
const avatarContainerStyles = StyleUtils.getContainerStyles(size, isInReportAction);
423423

424424
const avatarSizeToStylesMap: AvatarSizeToStylesMap = useMemo(
@@ -432,8 +432,8 @@ function ReportActionAvatarMultipleDiagonal({
432432
secondAvatarStyles: styles.secondAvatarMedium,
433433
},
434434
[CONST.AVATAR_SIZE.X_LARGE]: {
435-
singleAvatarStyle: styles.singleAvatarLarge,
436-
secondAvatarStyles: styles.secondAvatarLarge,
435+
singleAvatarStyle: styles.singleAvatarMediumLarge,
436+
secondAvatarStyles: styles.secondAvatarMediumLarge,
437437
},
438438
[CONST.AVATAR_SIZE.DEFAULT]: {
439439
singleAvatarStyle: styles.singleAvatar,
@@ -453,7 +453,7 @@ function ReportActionAvatarMultipleDiagonal({
453453
}
454454

455455
if (size === CONST.AVATAR_SIZE.X_LARGE) {
456-
return CONST.AVATAR_SIZE.LARGE;
456+
return CONST.AVATAR_SIZE.MEDIUM_LARGE;
457457
}
458458

459459
return CONST.AVATAR_SIZE.SMALLER;
@@ -463,7 +463,7 @@ function ReportActionAvatarMultipleDiagonal({
463463
const secondaryAvatarContainerStyles = secondaryAvatarContainerStyle ?? [StyleUtils.getBackgroundAndBorderStyle(isHovered ? theme.activeComponentBG : theme.componentBG)];
464464

465465
return (
466-
<View style={[avatarContainerStyles, useHugeBottomMargin && styles.mb7]}>
466+
<View style={[avatarContainerStyles, removeRightMargin && styles.mr0]}>
467467
<View
468468
style={[singleAvatarStyle, icons.at(0)?.type === CONST.ICON_TYPE_WORKSPACE && StyleUtils.getAvatarBorderRadius(size, icons.at(0)?.type)]}
469469
testID="ReportActionAvatars-MultipleAvatars"

src/styles/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,11 +2380,11 @@ const styles = (theme: ThemeColors) =>
23802380
borderRadius: 52,
23812381
},
23822382

2383-
singleAvatarLarge: {
2384-
height: 80,
2385-
width: 80,
2383+
singleAvatarMediumLarge: {
2384+
height: 60,
2385+
width: 60,
23862386
backgroundColor: theme.icon,
2387-
borderRadius: 52,
2387+
borderRadius: 80,
23882388
},
23892389

23902390
secondAvatar: {
@@ -2407,18 +2407,18 @@ const styles = (theme: ThemeColors) =>
24072407

24082408
secondAvatarMedium: {
24092409
position: 'absolute',
2410-
right: -42,
2411-
bottom: -42,
2410+
right: -36,
2411+
bottom: -36,
24122412
borderWidth: 3,
24132413
borderRadius: 52,
24142414
borderColor: 'transparent',
24152415
},
24162416

2417-
secondAvatarLarge: {
2417+
secondAvatarMediumLarge: {
24182418
position: 'absolute',
2419-
right: -50,
2420-
bottom: -50,
2421-
borderWidth: 4,
2419+
right: -42,
2420+
bottom: -42,
2421+
borderWidth: 3,
24222422
borderRadius: 80,
24232423
borderColor: 'transparent',
24242424
},

src/styles/utils/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const avatarBorderSizes: Partial<Record<AvatarSizeName, number>> = {
100100
[CONST.AVATAR_SIZE.MEDIUM]: variables.componentBorderRadiusLarge,
101101
[CONST.AVATAR_SIZE.LARGE]: variables.componentBorderRadiusLarge,
102102
[CONST.AVATAR_SIZE.X_LARGE]: variables.componentBorderRadiusLarge,
103+
[CONST.AVATAR_SIZE.MEDIUM_LARGE]: variables.componentBorderRadiusLarge,
103104
[CONST.AVATAR_SIZE.LARGE_BORDERED]: variables.componentBorderRadiusRounded,
104105
[CONST.AVATAR_SIZE.SMALL_NORMAL]: variables.componentBorderRadiusMedium,
105106
};
@@ -115,6 +116,7 @@ const avatarSizes: Record<AvatarSizeName, AvatarSizeValue> = {
115116
[CONST.AVATAR_SIZE.X_LARGE]: variables.avatarSizeXLarge,
116117
[CONST.AVATAR_SIZE.MEDIUM]: variables.avatarSizeMedium,
117118
[CONST.AVATAR_SIZE.LARGE_BORDERED]: variables.avatarSizeLargeBordered,
119+
[CONST.AVATAR_SIZE.MEDIUM_LARGE]: variables.avatarSizeMediumLarge,
118120
[CONST.AVATAR_SIZE.HEADER]: variables.avatarSizeHeader,
119121
[CONST.AVATAR_SIZE.MENTION_ICON]: variables.avatarSizeMentionIcon,
120122
[CONST.AVATAR_SIZE.SMALL_NORMAL]: variables.avatarSizeSmallNormal,
@@ -129,6 +131,7 @@ const avatarFontSizes: Partial<Record<AvatarSizeName, number>> = {
129131
[CONST.AVATAR_SIZE.SMALL]: variables.fontSizeSmall,
130132
[CONST.AVATAR_SIZE.SMALLER]: variables.fontSizeExtraSmall,
131133
[CONST.AVATAR_SIZE.LARGE]: variables.fontSizeXLarge,
134+
[CONST.AVATAR_SIZE.MEDIUM_LARGE]: variables.fontSizeXLarge,
132135
[CONST.AVATAR_SIZE.MEDIUM]: variables.fontSizeMedium,
133136
[CONST.AVATAR_SIZE.LARGE_BORDERED]: variables.fontSizeXLarge,
134137
};
@@ -142,6 +145,7 @@ const avatarBorderWidths: Partial<Record<AvatarSizeName, number>> = {
142145
[CONST.AVATAR_SIZE.SMALLER]: 2,
143146
[CONST.AVATAR_SIZE.HEADER]: 2,
144147
[CONST.AVATAR_SIZE.LARGE]: 4,
148+
[CONST.AVATAR_SIZE.MEDIUM_LARGE]: 3,
145149
[CONST.AVATAR_SIZE.X_LARGE]: 4,
146150
[CONST.AVATAR_SIZE.MEDIUM]: 3,
147151
[CONST.AVATAR_SIZE.LARGE_BORDERED]: 4,

src/styles/utils/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type AvatarSizeValue = ValueOf<
2222
| 'avatarSizeXLarge'
2323
| 'avatarSizeLarge'
2424
| 'avatarSizeMedium'
25+
| 'avatarSizeMediumLarge'
2526
| 'avatarSizeLargeBordered'
2627
| 'avatarSizeHeader'
2728
| 'avatarSizeMentionIcon'

src/styles/variables.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default {
3535
avatarSizeLargeBordered: 88,
3636
avatarSizeXLarge: 100,
3737
avatarSizeLarge: 80,
38+
avatarSizeMediumLarge: 60,
3839
avatarSizeMedium: 52,
3940
avatarSizeHeader: 40,
4041
avatarSizeNormal: 40,

0 commit comments

Comments
 (0)