-
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 #2505 from anuradha9712/feat-avatar-group-presence…
…-support feat(avatarGroup): add presence support in avatar group component
- Loading branch information
Showing
6 changed files
with
138 additions
and
15 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
106 changes: 106 additions & 0 deletions
106
core/components/atoms/avatarGroup/__stories__/withPresence.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,106 @@ | ||
import * as React from 'react'; | ||
import { AvatarGroup, Avatar } from '@/index'; | ||
|
||
export const withPresence = () => { | ||
const presenceList = [ | ||
{ | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
}, | ||
{ | ||
firstName: 'Steven', | ||
lastName: 'Packton', | ||
presence: 'active', | ||
}, | ||
{ | ||
firstName: 'Nancy', | ||
lastName: 'Wheeler', | ||
presence: 'away', | ||
}, | ||
{ | ||
firstName: 'Monica', | ||
lastName: 'Geller', | ||
}, | ||
{ | ||
firstName: 'Anuradha', | ||
lastName: 'Aggarwal', | ||
image: <Avatar.Image src="https://design.innovaccer.com/images/avatar2.jpeg" />, | ||
presence: 'active', | ||
}, | ||
{ | ||
firstName: 'Rachel', | ||
lastName: 'Green', | ||
presence: 'away', | ||
disabled: true, | ||
}, | ||
{ | ||
firstName: 'Walter', | ||
lastName: 'Wheeler', | ||
presence: 'away', | ||
}, | ||
{ | ||
firstName: 'Mark', | ||
lastName: 'Snow', | ||
}, | ||
]; | ||
|
||
return <AvatarGroup list={presenceList} />; | ||
}; | ||
|
||
const customCode = `() => { | ||
const presenceList = [ | ||
{ | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
}, | ||
{ | ||
firstName: 'Steven', | ||
lastName: 'Packton', | ||
presence: 'active', | ||
}, | ||
{ | ||
firstName: 'Nancy', | ||
lastName: 'Wheeler', | ||
presence: 'away', | ||
}, | ||
{ | ||
firstName: 'Monica', | ||
lastName: 'Geller', | ||
}, | ||
{ | ||
firstName: 'Anuradha', | ||
lastName: 'Aggarwal', | ||
image: <Avatar.Image src="https://design.innovaccer.com/images/avatar2.jpeg" />, | ||
presence: 'active', | ||
}, | ||
{ | ||
firstName: 'Rachel', | ||
lastName: 'Green', | ||
presence: 'away', | ||
disabled: true, | ||
}, | ||
{ | ||
firstName: 'Walter', | ||
lastName: 'Wheeler', | ||
presence: 'away', | ||
}, | ||
{ | ||
firstName: 'Mark', | ||
lastName: 'Snow', | ||
}, | ||
]; | ||
return <AvatarGroup list={presenceList} />; | ||
}`; | ||
|
||
export default { | ||
title: 'Components/Avatar/AvatarGroup/With Presence', | ||
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