-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2496 from anuradha9712/feat-avatar-group-status-i…
…ndicator feat(avatarGroup): add status indicator support in avatar group compo…
- Loading branch information
Showing
6 changed files
with
215 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
core/components/atoms/avatarGroup/__stories__/withStatus.story.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
import * as React from 'react'; | ||
import { AvatarGroup, Tooltip, Icon, Avatar } from '@/index'; | ||
|
||
export const withStatus = () => { | ||
const statusList = [ | ||
{ | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
}, | ||
{ | ||
firstName: 'Steven', | ||
lastName: 'Packton', | ||
status: ( | ||
<Tooltip position="top" tooltip="Verified"> | ||
<Icon appearance="white" className="p-1 bg-success" name="done" size={10} /> | ||
</Tooltip> | ||
), | ||
}, | ||
{ | ||
firstName: 'Nancy', | ||
lastName: 'Wheeler', | ||
status: ( | ||
<Tooltip position="top" tooltip="On Call"> | ||
<Icon appearance="white" className="p-1 bg-primary" name="phone" size={10} /> | ||
</Tooltip> | ||
), | ||
}, | ||
{ | ||
firstName: 'Monica', | ||
lastName: 'Geller', | ||
}, | ||
{ | ||
firstName: 'Anuradha', | ||
lastName: 'Aggarwal', | ||
image: <Avatar.Image src="https://design.innovaccer.com/images/avatar2.jpeg" />, | ||
status: ( | ||
<Tooltip position="top" tooltip="Verified"> | ||
<Icon appearance="white" className="p-1 bg-success" name="done" size={10} /> | ||
</Tooltip> | ||
), | ||
}, | ||
{ | ||
firstName: 'Rachel', | ||
lastName: 'Green', | ||
}, | ||
{ | ||
firstName: 'Walter', | ||
lastName: 'Wheeler', | ||
}, | ||
{ | ||
firstName: 'Mark', | ||
lastName: 'Snow', | ||
}, | ||
]; | ||
|
||
return <AvatarGroup list={statusList} />; | ||
}; | ||
|
||
const customCode = `() => { | ||
const statusList = [ | ||
{ | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
}, | ||
{ | ||
firstName: 'Steven', | ||
lastName: 'Packton', | ||
status: ( | ||
<Tooltip position="top" tooltip="Verified"> | ||
<Icon appearance="white" className="p-1 bg-success" name="done" size={10} /> | ||
</Tooltip> | ||
), | ||
}, | ||
{ | ||
firstName: 'Nancy', | ||
lastName: 'Wheeler', | ||
status: ( | ||
<Tooltip position="top" tooltip="On Call"> | ||
<Icon appearance="white" className="p-1 bg-primary" name="phone" size={10} /> | ||
</Tooltip> | ||
), | ||
}, | ||
{ | ||
firstName: 'Monica', | ||
lastName: 'Geller', | ||
}, | ||
{ | ||
firstName: 'Anuradha', | ||
lastName: 'Aggarwal', | ||
image: <Avatar.Image src="https://design.innovaccer.com/images/avatar2.jpeg" />, | ||
status: ( | ||
<Tooltip position="top" tooltip="Verified"> | ||
<Icon appearance="white" className="p-1 bg-success" name="done" size={10} /> | ||
</Tooltip> | ||
), | ||
}, | ||
{ | ||
firstName: 'Rachel', | ||
lastName: 'Green', | ||
}, | ||
{ | ||
firstName: 'Walter', | ||
lastName: 'Wheeler', | ||
}, | ||
{ | ||
firstName: 'Mark', | ||
lastName: 'Snow', | ||
}, | ||
]; | ||
return <AvatarGroup list={statusList} />; | ||
}`; | ||
|
||
export default { | ||
title: 'Components/Avatar/AvatarGroup/With Status', | ||
component: AvatarGroup, | ||
parameters: { | ||
docs: { | ||
docPage: { | ||
customCode, | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters