Skip to content

Commit

Permalink
feat(AvatarGroupCounter): pass noAnimation prop (#2010)
Browse files Browse the repository at this point in the history
  • Loading branch information
talkor authored Mar 12, 2024
1 parent 7486fb5 commit 048b163
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/core/src/components/AvatarGroup/AvatarGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type AvatarGroupCounterVisualProps = {
prefix?: string;
maxDigits?: number;
ariaLabelItemsName?: string;
noAnimation?: boolean;
};

export interface AvatarGroupProps extends VibeComponentProps {
Expand Down
14 changes: 12 additions & 2 deletions packages/core/src/components/AvatarGroup/AvatarGroupCounter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const AvatarGroupCounter: React.FC<AvatarGroupCounterProps> = ({
count: counterValue = counterTooltipAvatars.length,
prefix: counterPrefix = "+",
maxDigits: counterMaxDigits = 3,
ariaLabelItemsName: counterAriaLabelItemsName = "items"
ariaLabelItemsName: counterAriaLabelItemsName = "items",
noAnimation
} = counterProps || {};

const counterSizeStyle = getStyle(styles, size?.toString());
Expand All @@ -62,9 +63,18 @@ const AvatarGroupCounter: React.FC<AvatarGroupCounterProps> = ({
prefix={counterPrefix}
maxDigits={counterMaxDigits}
ariaLabel={counterAriaLabel ? counterAriaLabel : `Tab for more ${counterAriaLabelItemsName}`}
noAnimation={noAnimation}
/>
);
}, [counterAriaLabel, counterAriaLabelItemsName, counterColor, counterMaxDigits, counterPrefix, counterValue]);
}, [
counterAriaLabel,
counterAriaLabelItemsName,
counterColor,
counterMaxDigits,
counterPrefix,
counterValue,
noAnimation
]);

if (!counterTooltipAvatars.length && !counterValue) {
return null;
Expand Down

0 comments on commit 048b163

Please sign in to comment.