Skip to content

Commit

Permalink
handle more reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Apr 14, 2019
1 parent e8fab84 commit 4a9254f
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 24 deletions.
4 changes: 1 addition & 3 deletions docs/src/pages/demos/dividers/InsetDividers.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ function InsetDividers(props) {
</ListItemAvatar>
<ListItemText primary="Photos" secondary="Jan 9, 2014" />
</ListItem>
<li>
<Divider variant="inset" />
</li>
<Divider variant="inset" component="li" />
<ListItem>
<ListItemAvatar>
<Avatar>
Expand Down
4 changes: 1 addition & 3 deletions docs/src/pages/demos/dividers/InsetDividers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ function InsetDividers(props: Props) {
</ListItemAvatar>
<ListItemText primary="Photos" secondary="Jan 9, 2014" />
</ListItem>
<li>
<Divider variant="inset" />
</li>
<Divider variant="inset" component="li" />
<ListItem>
<ListItemAvatar>
<Avatar>
Expand Down
8 changes: 2 additions & 6 deletions docs/src/pages/demos/lists/AlignItemsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ function AlignItemsList(props) {
}
/>
</ListItem>
<li>
<Divider variant="inset" />
</li>
<Divider variant="inset" component="li" />
<ListItem alignItems="flex-start">
<ListItemAvatar>
<Avatar alt="Remy Sharp" src="/static/images/avatar/2.jpg" />
Expand All @@ -69,9 +67,7 @@ function AlignItemsList(props) {
}
/>
</ListItem>
<li>
<Divider variant="inset" />
</li>
<Divider variant="inset" component="li" />
<ListItem alignItems="flex-start">
<ListItemAvatar>
<Avatar alt="Remy Sharp" src="/static/images/avatar/3.jpg" />
Expand Down
8 changes: 2 additions & 6 deletions docs/src/pages/demos/lists/AlignItemsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ function AlignItemsList(props: AlignItemListProps) {
}
/>
</ListItem>
<li>
<Divider variant="inset" />
</li>
<Divider variant="inset" component="li" />
<ListItem alignItems="flex-start">
<ListItemAvatar>
<Avatar alt="Remy Sharp" src="/static/images/avatar/2.jpg" />
Expand All @@ -72,9 +70,7 @@ function AlignItemsList(props: AlignItemListProps) {
}
/>
</ListItem>
<li>
<Divider variant="inset" />
</li>
<Divider variant="inset" component="li" />
<ListItem alignItems="flex-start">
<ListItemAvatar>
<Avatar alt="Remy Sharp" src="/static/images/avatar/3.jpg" />
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/lists/CheckboxListSecondary.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function CheckboxListSecondary() {
};

return (
<List className={classes.root}>
<List dense className={classes.root}>
{[0, 1, 2, 3].map(value => (
<ListItem key={value} button>
<ListItemAvatar>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/demos/lists/CheckboxListSecondary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function CheckboxListSecondary() {
};

return (
<List className={classes.root}>
<List dense className={classes.root}>
{[0, 1, 2, 3].map(value => (
<ListItem key={value} button>
<ListItemAvatar>
Expand Down
4 changes: 4 additions & 0 deletions packages/material-ui/src/Divider/Divider.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export const styles = theme => ({
const Divider = React.forwardRef(function Divider(props, ref) {
const { absolute, classes, className, component: Component, light, variant, ...other } = props;

if (Component === 'li' && !other.role) {
other.role = 'separator';
}

return (
<Component
className={clsx(
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/ListItemAvatar/ListItemAvatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const styles = {
/* Styles applied to the root element. */
root: {
minWidth: 56,
flexShrink: 0,
},
/* Styles applied to the root element when the parent `ListItem` uses `alignItems="flex-start"`. */
alignItemsFlexStart: {
Expand All @@ -16,8 +17,7 @@ export const styles = {
};

/**
* This is a simple wrapper to apply the `dense`
* and `align-items="flex-start"` mode styles to `Avatar`.
* A simple wrapper to apply `List` styles to an `Avatar`.
*/
const ListItemAvatar = React.forwardRef(function ListItemAvatar(props, ref) {
const { classes, className, ...other } = props;
Expand Down
3 changes: 1 addition & 2 deletions pages/api/list-item-avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ filename: /packages/material-ui/src/ListItemAvatar/ListItemAvatar.js
import ListItemAvatar from '@material-ui/core/ListItemAvatar';
```

This is a simple wrapper to apply the `dense`
and `align-items="flex-start"` mode styles to `Avatar`.
A simple wrapper to apply `List` styles to an `Avatar`.

## Props

Expand Down

0 comments on commit 4a9254f

Please sign in to comment.