-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(avatar): add status indicator support in avatar
- Loading branch information
1 parent
0164f24
commit 5885784
Showing
7 changed files
with
140 additions
and
1 deletion.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions
30
core/components/atoms/avatar/__stories__/statusWithIcon.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,30 @@ | ||
import * as React from 'react'; | ||
import { Avatar, Icon, Tooltip } from '@/index'; | ||
|
||
// CSF format story | ||
export const statusWithIcon = () => { | ||
return ( | ||
<Avatar | ||
lastName="Doe" | ||
firstName="John" | ||
appearance="primary" | ||
status={ | ||
<Tooltip tooltip="Verified" position="top"> | ||
<Icon name="done" size={10} appearance="white" className="p-1 bg-success" /> | ||
</Tooltip> | ||
} | ||
/> | ||
); | ||
}; | ||
|
||
export default { | ||
title: 'Components/Avatar/Avatar/Status/Status With Icon', | ||
component: Avatar, | ||
parameters: { | ||
docs: { | ||
docPage: { | ||
title: 'Avatar', | ||
}, | ||
}, | ||
}, | ||
}; |
31 changes: 31 additions & 0 deletions
31
core/components/atoms/avatar/__stories__/statusWithImage.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,31 @@ | ||
import * as React from 'react'; | ||
import { Avatar, Tooltip } from '@/index'; | ||
import StatusImage from './assets/status-image.png'; | ||
|
||
// CSF format story | ||
export const statusWithImage = () => { | ||
return ( | ||
<Avatar | ||
firstName="Tom" | ||
lastName="Yusuf" | ||
appearance="accent1" | ||
status={ | ||
<Tooltip tooltip="DND" position="top"> | ||
<img width="14px" alt="DND" src={StatusImage} /> | ||
</Tooltip> | ||
} | ||
/> | ||
); | ||
}; | ||
|
||
export default { | ||
title: 'Components/Avatar/Avatar/Status/Status With Image', | ||
component: Avatar, | ||
parameters: { | ||
docs: { | ||
docPage: { | ||
title: 'Avatar', | ||
}, | ||
}, | ||
}, | ||
}; |
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