Skip to content

Commit

Permalink
Merge pull request #3612 from mbrookes/list-remove-paper
Browse files Browse the repository at this point in the history
[List] Remove Paper
  • Loading branch information
mbrookes committed Mar 10, 2016
2 parents 0f9b467 + bab61a2 commit d768a13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import MUI from 'material-ui' // no changes here 😀

- [Styles] RaisedButton, FlatButton, and FloatingActionButton now properly use primary/secondary colors
- [Menu] Remove Paper (#3559)
- [List] Remove Paper (#3612)

## 0.15.0-alpha.1
###### _Feb 27, 2016_
Expand Down
20 changes: 9 additions & 11 deletions src/lists/list.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import PropTypes from '../utils/prop-types';
import Paper from '../paper';
import getMuiTheme from '../styles/getMuiTheme';
import Subheader from '../Subheader';
import deprecated from '../utils/deprecatedPropType';
import warning from 'warning';

const List = React.createClass({

Expand Down Expand Up @@ -39,7 +39,9 @@ const List = React.createClass({
'Refer to the `subheader` property.'),

/**
* The zDepth prop passed to the Paper element inside list.
* @ignore
* ** Breaking change ** List no longer supports `zDepth`. Instead, wrap it in `Paper`
* or another component that provides zDepth.
*/
zDepth: PropTypes.zDepth,
},
Expand All @@ -56,12 +58,6 @@ const List = React.createClass({
PureRenderMixin,
],

getDefaultProps() {
return {
zDepth: 0,
};
},

getInitialState() {
return {
muiTheme: this.context.muiTheme || getMuiTheme(),
Expand Down Expand Up @@ -91,6 +87,9 @@ const List = React.createClass({
...other,
} = this.props;

warning((typeof zDepth === 'undefined'), 'List no longer supports `zDepth`. Instead, wrap it in `Paper` ' +
'or another component that provides zDepth.');

let hasSubheader = false;

if (subheader) {
Expand All @@ -111,14 +110,13 @@ const List = React.createClass({
};

return (
<Paper
<div
{...other}
style={Object.assign(styles.root, style)}
zDepth={zDepth}
>
{subheader && <Subheader inset={insetSubheader} style={subheaderStyle}>{subheader}</Subheader>}
{children}
</Paper>
</div>
);
},
});
Expand Down

0 comments on commit d768a13

Please sign in to comment.