Skip to content

Commit

Permalink
add support for className prop in the avatar stack
Browse files Browse the repository at this point in the history
  • Loading branch information
randall-krauskopf committed Oct 9, 2024
1 parent 6cd3960 commit 2773369
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions packages/react/src/AvatarStack/AvatarStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,32 @@ export type AvatarStackProps = {
alignRight?: boolean
disableExpand?: boolean
size?: number | ResponsiveValue<number>
className?: string
children: React.ReactNode
} & SxProp

const AvatarStack = ({children, alignRight, disableExpand, size, sx: sxProp = defaultSxProp}: AvatarStackProps) => {
const AvatarStack = ({
children,
alignRight,
disableExpand,
size,
className,
sx: sxProp = defaultSxProp,
}: AvatarStackProps) => {
const count = React.Children.count(children)
const wrapperClassNames = clsx({
'pc-AvatarStack--two': count === 2,
'pc-AvatarStack--three': count === 3,
'pc-AvatarStack--three-plus': count > 3,
'pc-AvatarStack--right': alignRight,
})
const bodyClassNames = clsx('pc-AvatarStackBody', {
'pc-AvatarStack--disableExpand': disableExpand,
})
const bodyClassNames = clsx(
'pc-AvatarStackBody',
{
'pc-AvatarStack--disableExpand': disableExpand,
},
className,
)

const getAvatarChildSizes = () => {
const avatarSizeMap: Record<WidthOnlyViewportRangeKeys, number[]> = {
Expand Down

0 comments on commit 2773369

Please sign in to comment.