-
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.
feat(avatarGroup): add presence support in avatar group component
- Loading branch information
1 parent
2fcda21
commit 20193fd
Showing
7 changed files
with
339 additions
and
28 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 statusList = [ | ||
{ | ||
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={statusList} />; | ||
}; | ||
|
||
const customCode = `() => { | ||
const statusList = [ | ||
{ | ||
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={statusList} />; | ||
}`; | ||
|
||
export default { | ||
title: 'Components/Avatar/AvatarGroup/With Presence', | ||
component: AvatarGroup, | ||
parameters: { | ||
docs: { | ||
docPage: { | ||
customCode, | ||
}, | ||
}, | ||
}, | ||
}; |
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, | ||
}, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.