Skip to content

Commit

Permalink
Add user image lookup examples to UserAvatar story
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Apr 21, 2021
1 parent ef29fdf commit 8e00db2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/components/UserAvatar/UserAvatar.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,24 @@ If the `name` prop is passed, the UserAvatar will display the first letter of th
</Story>
</Canvas>

## With An Alias
If you pass a valid career account username, their corresponding picture will be loaded from ECNDB.

**Note:** This is a [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) request and will only work when serving the docs from under engineering.purdue.edu. This means the CORS request will fail in development. You can use [this Chrome extension](https://chrome.google.com/webstore/detail/moesif-origin-cors-change/digfbfaphojjndkpccljibejjbppifbc) or similar to temporarily disable CORS protections.

<Canvas>
<Story
name="With An Alias"
args={{
alias: "campb303"
}}
>
{ args => <UserAvatar {...args} /> }
</Story>
</Canvas>

## Forwarded Props
All props other than `name` are passed to the underlying [MUI Avatar component](https://material-ui.com/api/avatar/).
All props not listed in the table below are passed to the underlying [MUI Avatar component](https://material-ui.com/api/avatar/).

<Canvas>
<Story
Expand Down

0 comments on commit 8e00db2

Please sign in to comment.