Skip to content

Commit

Permalink
let's merge
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Aug 18, 2018
1 parent 90226be commit 2bad316
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
4 changes: 3 additions & 1 deletion docs/src/pages/demos/lists/NestedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const styles = theme => ({
});

class NestedList extends React.Component {
state = { open: true };
state = {
open: true,
};

handleClick = () => {
this.setState(state => ({ open: !state.open }));
Expand Down
6 changes: 3 additions & 3 deletions packages/material-ui/.size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"build/umd/material-ui.production.min.js": {
"bundled": 815343,
"minified": 304485,
"gzipped": 80259
"bundled": 815209,
"minified": 304447,
"gzipped": 80249
}
}
8 changes: 4 additions & 4 deletions packages/material-ui/src/ListSubheader/ListSubheader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { StandardProps } from '..';

export interface ListSubheaderProps
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, ListSubheaderClassKey> {
component?: React.ReactType<ListSubheaderProps>;
color?: 'default' | 'primary' | 'inherit';
inset?: boolean;
disableSticky?: boolean;
component?: React.ReactType<ListSubheaderProps>;
disableGutters?: boolean;
disableSticky?: boolean;
inset?: boolean;
}

export type ListSubheaderClassKey = 'root' | 'colorPrimary' | 'colorInherit' | 'inset' | 'sticky' | 'nogutters';
export type ListSubheaderClassKey = 'root' | 'colorPrimary' | 'colorInherit' | 'inset' | 'sticky' | 'gutters';

declare const ListSubheader: React.ComponentType<ListSubheaderProps>;

Expand Down
17 changes: 7 additions & 10 deletions packages/material-ui/src/ListSubheader/ListSubheader.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { capitalize } from '../utils/helpers';

export const styles = theme => ({
/* Styles applied to the root element. */
root: theme.mixins.gutters({
root: {
boxSizing: 'border-box',
lineHeight: '48px',
listStyle: 'none',
color: theme.palette.text.secondary,
fontFamily: theme.typography.fontFamily,
fontWeight: theme.typography.fontWeightMedium,
fontSize: theme.typography.pxToRem(14),
}),
},
/* Styles applied to the root element if `color="primary"`. */
colorPrimary: {
color: theme.palette.primary.main,
Expand All @@ -23,6 +23,8 @@ export const styles = theme => ({
colorInherit: {
color: 'inherit',
},
/* Styles applied to the inner `component` element if `disableGutters={false}`. */
gutters: theme.mixins.gutters(),
/* Styles applied to the root element if `inset={true}`. */
inset: {
paddingLeft: 72,
Expand All @@ -34,11 +36,6 @@ export const styles = theme => ({
zIndex: 1,
backgroundColor: 'inherit',
},
/* Styles appiled to the root element if `disableGutters={trze}`. */
nogutters: {
paddingLeft: 0,
paddingRight: 0,
},
});

function ListSubheader(props) {
Expand All @@ -47,8 +44,8 @@ function ListSubheader(props) {
className,
color,
component: Component,
disableSticky,
disableGutters,
disableSticky,
inset,
...other
} = props;
Expand All @@ -61,7 +58,7 @@ function ListSubheader(props) {
[classes[`color${capitalize(color)}`]]: color !== 'default',
[classes.inset]: inset,
[classes.sticky]: !disableSticky,
[classes.nogutters]: disableGutters,
[classes.gutters]: !disableGutters,
},
className,
)}
Expand Down Expand Up @@ -110,8 +107,8 @@ ListSubheader.propTypes = {
ListSubheader.defaultProps = {
color: 'default',
component: 'li',
disableSticky: false,
disableGutters: false,
disableSticky: false,
inset: false,
};

Expand Down
8 changes: 4 additions & 4 deletions packages/material-ui/src/ListSubheader/ListSubheader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ describe('<ListSubheader />', () => {
});

describe('prop: disableGutters', () => {
it('should display nogutters class', () => {
it('should not display gutters class', () => {
const wrapper = shallow(<ListSubheader disableGutters />);
assert.strictEqual(wrapper.hasClass(classes.nogutters), true);
assert.strictEqual(wrapper.hasClass(classes.gutters), false);
});

it('should not display nogutters class', () => {
it('should display gutters class', () => {
const wrapper = shallow(<ListSubheader />);
assert.strictEqual(wrapper.hasClass(classes.nogutters), false);
assert.strictEqual(wrapper.hasClass(classes.gutters), true);
});
});
});
2 changes: 1 addition & 1 deletion pages/api/list-subheader.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ This property accepts the following keys:
| <span class="prop-name">root</span> | Styles applied to the root element.
| <span class="prop-name">colorPrimary</span> | Styles applied to the root element if `color="primary"`.
| <span class="prop-name">colorInherit</span> | Styles applied to the root element if `color="inherit"`.
| <span class="prop-name">gutters</span> | Styles applied to the inner `component` element if `disableGutters={false}`.
| <span class="prop-name">inset</span> | Styles applied to the root element if `inset={true}`.
| <span class="prop-name">sticky</span> | Styles applied to the root element if `disableSticky={false}`.
| <span class="prop-name">nogutters</span> | Styles appiled to the root element if `disableGutters={trze}`.

Have a look at [overriding with classes](/customization/overrides#overriding-with-classes) section
and the [implementation of the component](https://github.com/mui-org/material-ui/tree/master/packages/material-ui/src/ListSubheader/ListSubheader.js)
Expand Down

0 comments on commit 2bad316

Please sign in to comment.