Skip to content

Commit

Permalink
only keep small
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Feb 19, 2020
1 parent 0ce81e0 commit 6b77702
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/pages/api/avatar-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi
|:-----|:-----|:--------|:------------|
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The avatars to stack. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |
| <span class="prop-name">spacing</span> | <span class="prop-type">'large'<br>&#124;&nbsp;'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;number</span> | <span class="prop-default">'medium'</span> | Spacing between avatars. |
| <span class="prop-name">spacing</span> | <span class="prop-type">'medium'<br>&#124;&nbsp;'small'<br>&#124;&nbsp;number</span> | <span class="prop-default">'medium'</span> | Spacing between avatars. |

The `ref` is forwarded to the root element.

Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui-lab/src/AvatarGroup/AvatarGroup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface AvatarGroupProps
/**
* Spacing between avatars.
*/
spacing?: 'small' | 'medium' | 'large' | number;
spacing?: 'small' | 'medium' | number;
}

export type AvatarGroupClassKey = 'root' | 'avatar';
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui-lab/src/AvatarGroup/AvatarGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import clsx from 'clsx';
import { withStyles } from '@material-ui/core/styles';

const SPACINGS = {
large: -4,
small: -16,
medium: null,
};

export const styles = theme => ({
Expand Down Expand Up @@ -46,7 +46,7 @@ const AvatarGroup = React.forwardRef(function AvatarGroup(props, ref) {
className: clsx(child.props.className, classes.avatar),
style: {
zIndex: children.length - index,
marginLeft: spacing && SPACINGS[spacing] ? SPACINGS[spacing] : -spacing,
marginLeft: spacing && SPACINGS[spacing] !== undefined ? SPACINGS[spacing] : -spacing,
...child.props.style,
},
});
Expand Down Expand Up @@ -76,7 +76,7 @@ AvatarGroup.propTypes = {
/**
* Spacing between avatars.
*/
spacing: PropTypes.oneOfType([PropTypes.oneOf(['large', 'medium', 'small']), PropTypes.number]),
spacing: PropTypes.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.number]),
};

export default withStyles(styles, { name: 'MuiAvatarGroup' })(AvatarGroup);

0 comments on commit 6b77702

Please sign in to comment.