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

[ListItemAvatar] Fix & refactor #6540

Merged
merged 1 commit into from Apr 8, 2017
Merged

[ListItemAvatar] Fix & refactor #6540

merged 1 commit into from Apr 8, 2017

Conversation

mbrookes
Copy link
Member

@mbrookes mbrookes commented Apr 8, 2017

  • It didn't work at all - wrong MUI_SHEET_ORDER
  • If it had worked, the avatar was the wrong size, and the icon wasn't resized
  • Simplified usage - styles conditionaly aapplied if dense context is true
  • Updated the error message
  • Fixed the tests
  • Simplified the examples

Originally discussed here: #6483 (comment)

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).

The last thing to consider is making this a Proxy for Avatar so you don't have to separately import it, replacing:

<ListItemAvatar>
  <Avatar>
    <Icon />
  </Avatar>
</ListItemAvatar>

with:

<ListItemAvatar>
  <Icon />
</ListItemAvatar>

  - It didn't work at all - wrong MUI_SHEET_ORDER
  - If it had worked, the avatar was the wrong size, and the icon wasn't resized
  - Simplified usage - styles conditionaly aapplied if dense context is true
  - Updated the error message
  - Fixed the tests
  - Simplified the examples.
@mbrookes mbrookes added bug 🐛 Something doesn't work component: list This is the name of the generic UI component, not the React module! next labels Apr 8, 2017
@oliviertassinari
Copy link
Member

@mbrookes That looks do to me, regarding your last question, having a ListItemAvatar component sounds fair.

@mbrookes mbrookes deleted the next-fix-listitemavatar branch April 8, 2017 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: list This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants