File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -221,8 +221,6 @@ const useStyles = () => {
221221 alignItems : 'center' ,
222222 flexDirection : 'row' ,
223223 gap : primitives . spacingXs ,
224- paddingTop : primitives . spacingXs ,
225- paddingBottom : primitives . spacingXxs ,
226224 } ,
227225 messageRepliesText : {
228226 color : shouldUseOverlayStyles ? semantics . textOnAccent : semantics . textPrimary ,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { UserAvatar } from './UserAvatar';
1010import { BadgeCount } from '../Badge' ;
1111
1212export type AvatarStackProps = {
13- avatarSize ?: 'sm ' | 'md ' | 'xs' ;
13+ avatarSize ?: 'md ' | 'sm ' | 'xs' ;
1414 maxVisible ?: number ;
1515 items : React . ReactNode [ ] ;
1616 overlap ?: number ;
@@ -26,13 +26,16 @@ export const AvatarStack = (props: AvatarStackProps) => {
2626
2727 const totalWidth = diameter + ( visibleItems . length - 1 ) * visiblePortion ;
2828
29+ const badgeCountSize = avatarSize === 'md' ? 'lg' : avatarSize === 'sm' ? 'md' : 'sm' ;
30+
2931 return (
3032 < View style = { styles . wrapper } >
3133 < View
3234 style = { [
3335 styles . container ,
3436 {
3537 width : totalWidth ,
38+ height : diameter ,
3639 } ,
3740 ] }
3841 >
@@ -58,15 +61,11 @@ export const AvatarStack = (props: AvatarStackProps) => {
5861 style = { [
5962 styles . badgeCount ,
6063 {
61- // This is to ensure the badge is aligned with the last avatar in the stack
6264 marginLeft : - ( overlap * diameter ) ,
6365 } ,
6466 ] }
6567 >
66- < BadgeCount
67- count = { extraCount }
68- size = { avatarSize === 'sm' || avatarSize === 'md' ? 'md' : 'sm' }
69- />
68+ < BadgeCount count = { extraCount } size = { badgeCountSize } />
7069 </ View >
7170 ) }
7271 </ View >
@@ -88,8 +87,8 @@ export const UserAvatarStack = ({
8887} : UserAvatarStackProps ) => {
8988 const items = useMemo (
9089 ( ) =>
91- users . map ( ( user ) => {
92- return < UserAvatar key = { user . id } user = { user } size = { avatarSize } showBorder /> ;
90+ users . map ( ( user , index ) => {
91+ return < UserAvatar key = { ` ${ user . id } - ${ index } ` } user = { user } size = { avatarSize } showBorder /> ;
9392 } ) ,
9493 [ avatarSize , users ] ,
9594 ) ;
You can’t perform that action at this time.
0 commit comments