Skip to content

Commit ac1a5b6

Browse files
committed
feat(avatars): add hide plus button prop to component
1 parent ace2104 commit ac1a5b6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/components/Avatars/Avatars.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type AvatarsProps = {
1919
onAvatarsClick?: Function,
2020
onCounterClick?: Function,
2121
onPlusClick?: Function,
22+
withPlusButton?: boolean,
2223
};
2324

2425
const tooltipClassName = css`
@@ -38,6 +39,7 @@ const Avatars = ({
3839
onAvatarsClick,
3940
onCounterClick,
4041
onPlusClick,
42+
withPlusButton,
4143
...rest
4244
}: AvatarsProps) => {
4345
return (
@@ -61,9 +63,12 @@ const Avatars = ({
6163
<If condition={ users.length > 4 }>
6264
<AvatarsCounterTag onClick={ onCounterClick } size={ size }>+ { users.length - 4 }</AvatarsCounterTag>
6365
</If>
64-
<AvatarsHandleTag onClick={ onPlusClick } size={ size }>
65-
<Icon name="Plus" size="xs" color="PRIMARY" />
66-
</AvatarsHandleTag>
66+
67+
<If condition={ !!withPlusButton } >
68+
<AvatarsHandleTag onClick={ onPlusClick } size={ size }>
69+
<Icon name="Plus" size="xs" color="PRIMARY" />
70+
</AvatarsHandleTag>
71+
</If>
6772
</AvatarsTag>
6873
);
6974
};

src/components/Avatars/Avatars.stories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export default {
2020

2121
export const common = () => (
2222
<Column gap="lg">
23-
<Avatars size="md" users={ USERS } />
24-
<Avatars users={ USERS } />
23+
<Avatars size="md" users={ USERS } withPlusButton />
24+
<Avatars users={ USERS } withPlusButton />
2525
</Column>
2626
);
2727

0 commit comments

Comments
 (0)