Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: console warnings #1240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions www/examples/Tile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const Example = () => {
<div>
<React.Fragment>
<Carousel autoplay={false} style={{ width: '55vw' }} dots={false}>
{_.map(items, (item) => (
<Tile {...item} style={{ paddingRight: 10, width: 220, height: 300 }} />
{_.map(items, (item, i) => (
<Tile key={i} {...item} style={{ paddingRight: 10, width: 220, height: 300 }} />
))}
</Carousel>
</React.Fragment>
Expand Down
7 changes: 4 additions & 3 deletions www/examples/UserListPicker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ import DesignNotes from '../containers/DesignNotes.jsx';
## User List Picker

```jsx live=true
const avatarColor = (user) => (user.avatar ? '' : 'cyan');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The returned value is used as color props for Avatar component.
So, this method must return one of ['blue', 'green', 'red', 'orange', 'cyan', 'black'].

And as default if there is an image for Avatar component. the color will be not applied.
I just made another example to show how to use avatarColor() method.

const avatarColor = (user) => (user.status === 'active' ? 'blue' : 'orange');
const emptySvgSymbol = <SvgSymbol href="./assets/svg-symbols.svg#checklist-incomplete" />;
const teamMember1 = {
avatar: '../assets/user-avatar.jpeg',
givenName: 'John',
id: 1,
surname: 'Smith',
status: 'active',
};
const teamMember2 = { givenName: 'Jane', id: 2, surname: 'Doe' };
const teamMember3 = { givenName: 'Jack', id: 3, surname: 'White' };
const teamMember2 = { givenName: 'Jane', id: 2, surname: 'Doe', status: 'active' };
const teamMember3 = { givenName: 'Jack', id: 3, surname: 'White', status: 'pending' };
const listPickerItems = [teamMember1, teamMember2, teamMember3];
const listPickerInitialSelection = [teamMember2];
const listPickerItemHeaders = {
Expand Down