-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
Added GridList subheader #2979
Added GridList subheader #2979
Conversation
Thanks for your contribution @pradel! @oliviertassinari @alitaheri In matter of fact, this PR is an interesting discussion point because we have an opportunity here to not increase the API surface area of this component by adding additional props and making it required to just do something like: <GridList>
<Subheader style={customStyle}>My Subheader</Subheader>
{otherContent}
</GridList> We make |
Great idea if you want I can make a PR with a new |
Thanks @pradel, that would be great. You can use divider.jsx as an example. Could you put it in a |
@newoga can you said me which solution is the best? A |
I think also appbar title need new component it would be nice |
@pradel For now leave the render() {
const {
children,
insetSubheader,
style,
subheader,
subheaderStyle,
zDepth,
...other,
} = this.props;
const styles = {
root: {
padding: 0,
paddingBottom: 8,
paddingTop: subheader ? 0 : 8,
},
/** This can be removed since this would be in the Subheader.js component
subheader: {
color: Typography.textLightBlack,
fontSize: 14,
fontWeight: Typography.fontWeightMedium,
lineHeight: '48px',
paddingLeft: insetSubheader ? 72 : 16,
},*/
};
/** This can also be removed since this would be in the Subheader.js component
let subheaderElement;
if (subheader) {
const mergedSubheaderStyles = this.mergeStyles(styles.subheader, subheaderStyle);
subheaderElement = <div style={this.prepareStyles(mergedSubheaderStyles)}>{subheader}</div>;
}*/
return (
<Paper
{...other}
style={this.mergeStyles(styles.root, style)}
zDepth={zDepth}
>
{subheader ? <Subheader
inset={insetSubheader}
style={subheaderStyle}>{subheader}</Subheader> : null}
{children}
</Paper>
);
} |
Okay, maybe it's better to do the same for |
@newoga this looks good to you ? I made a |
If the long term plan is to deprecate the |
Yes I agree with @mbrookes here. Let's get the Otherwise, I think this looks good @pradel! If you can just make the changes to |
Okay so I removed the prop for |
@pradel Sorry for the delayed response, can you squash your commits? @oliviertassinari @alitaheri I think this is good for now. It's not a breaking change and helps a bit with code reusability. There are a few bigger picture things I'd like to run by your later that kind of ties into this but it's not urgent. |
Looks good 👍 👍 Thanks @pradel 😁 |
@pradel Looks good 👍 import React from 'react';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import colors from 'material-ui/lib/styles/colors';
const styles = {
root: {
fontSize: 14,
color: colors.lightBlack,
margin: 16,
fontWeight: 500,
},
};
const ListSubheader = React.createClass({
propTypes: {
subheader: React.PropTypes.string.isRequired,
},
mixins: [
PureRenderMixin,
],
render() {
return (
<div style={styles.root} data-test="ListSubheader">
{this.props.subheader}
</div>
);
},
});
export default ListSubheader; |
@oliviertassinari I agree that this could get it's own section in the documentation like |
It might make sense to add Subheader to one of the examples for each component this can be used from and cross reference it from there to the Subheader docs. I can pick this up once the PR is accepted. |
Hum sorry I think I made a mistake when I try to rebase can you guide me for that ? |
@pradel Are you familiar with interactive rebase? ## Add callemall/material-ui as remote
git remote add upstream git://github.com/callemall/material-ui.git
## fetch
git fetch upstream
## Rebase onto upstream master
git pull --rebase upstream master
## Rebase interactively (for squash)
git rebase -i upstream master
# Now you're in interactive rebase...
# (1) squash first two commits, save
# (2) edit commit message, save
# push remotely
git push -f origin |
Added GridList subheader - Added https://www.google.com/design/spec/components/subheaders.html#subheaders -grid-subheaders - Updated docs example make a separate Subheader component remove subheader prop from GridList make a separate Subheader component Added GridList subheader - Added https://www.google.com/design/spec/components/subheaders.html#subheaders -grid-subheaders - Updated docs example make a separate Subheader component make a separate Subheader component make a separate Subheader component
…inkButton & href props
Renamed prop identifier.
…Item] When checkbox className is not returned
This component really should have had a deprecation warning from 0.14.0 when the old `./menu/menu` implementation was deprecated. This component is not used in any other components in src or docs. It also is not documented on the site. I think we should add this warning ASAP and plan for removal along with `./menu/menu` in our first `0.15.0` release candidate.
Signed-off-by: Junliang Huang <i@jhuang.me>
@pradel Looks like something went wrong when you tried squashing. Do you still have your changes somewhere? |
@pradel Just to ease your mind. nothing ever gets deleted from git unless you brutally force it 😆 But now you have lost a pointer to your commits. you can take a look at your logs to see where you were before the rebase and make a branch on that particular commit. if you have a hard time finding it. you can email me your .git folder so i can fix this for you. |
|
@newoga yes I still have the changes :) |
@pradel Thanks for your work on this! |
@pradel I got your email. I'll have a look thank 😁 |
https://www.google.com/design/spec/components/subheaders.html#subheaders
-grid-subheaders