Skip to content
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

[Doc] Convert Toolbars to use the new standard. #2415

Merged
merged 5 commits into from
Dec 8, 2015

Conversation

alitaheri
Copy link
Member

@oliviertassinari I had to make some modifications to your PropTypeDescription to support multiple components per page. Also I did some improvements to fix some bugs, added className to ToolbarTitle to ensure consistency and migrated from menu to menus. Please review.

One last thing to note. seems like the new menus cannot be corretly positioned in a Toolbar the IconButton is not in the right place. But that doesn't have anything to do with this PR. merge if it's alright with you.

@alitaheri alitaheri added the docs Improvements or additions to the documentation label Dec 7, 2015
@alitaheri alitaheri added this to the Improve the documentation milestone Dec 7, 2015
@@ -60,7 +72,7 @@ const ToolbarTitle = React.createClass({
}, style);

return (
<span style={styles} {...other} >{text}</span>
<span className={this.props.className} style={styles} {...other} >{text}</span>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class is already inside the ...other could you extract it using the spread?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, sorry. on it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think that it's more wisely to put the {...other} at the beginning.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure thing. 👍

@alitaheri
Copy link
Member Author

@oliviertassinari Please check again. Is this better?

import ToolbarSeparator from 'material-ui/lib/toolbar/toolbar-separator';
import ToolbarTitle from 'material-ui/lib/toolbar/toolbar-title';

let menuItems = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const maybe?

@oliviertassinari
Copy link
Member

You must have seen that react/jsx-boolean-value: [2, always] is enforced.
That probably opinionated, I feel like it's better to be explicit.
I have tested the branch, it's fine for me 👍.

Remarque regarding the documentation:

  • We could add a max height to the doc example block and a button to expand it,
  • Increasing the marginTop of the MardownElement will probably improve readability.

@alitaheri
Copy link
Member Author

@oliviertassinari Thanks for the review. I will fix them asap.

And regarding jsx-boolean-value I don't really see much difference between the two. But what's like 100 times more important that opinions is consistency, 👍 for having that rule regardless of how it's enforced.

Increasing the marginTop of the MardownElement will probably improve readability.

You already did this 😁

We could add a max height to the doc example block and a button to expand it.

I will try to think of something. 👍

@alitaheri
Copy link
Member Author

@oliviertassinari Please review again. I think coding styles must be kept consistent, I did some aggressive changes 😈

@oliviertassinari
Copy link
Member

That's pretty agressive indeed.
I think that we should keep the function that return the style.
That's good for separation of concern, readability and will probably help for react-native style abstraction.

@@ -46,21 +67,33 @@ const Toolbar = React.createClass({
return this.state.muiTheme.toolbar;
},

getStyles() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a point, alright.

@alitaheri
Copy link
Member Author

@oliviertassinari Please check again

@@ -46,21 +67,36 @@ const Toolbar = React.createClass({
return this.state.muiTheme.toolbar;
},

getSpacing() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that the getSpacing and the getTheme are only called in the getStyles.
In this case, shouldn't we remove those two methods and add two variables in the getStyles?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thoughts exactly!! But this is somehow a bit global. I wanted to keep consistent with rest and propose this later on. If you agree, and follow the same path, we'll enforce some code styles as we migrate the docs and their corresponding components.

@oliviertassinari
Copy link
Member

@subjectix Thanks

oliviertassinari added a commit that referenced this pull request Dec 8, 2015
[Doc] Convert Toolbars to use the new standard.
@oliviertassinari oliviertassinari merged commit 1ab40bc into mui:master Dec 8, 2015
@alitaheri alitaheri deleted the doc-codgen-toolbars branch December 8, 2015 18:27
@alitaheri
Copy link
Member Author

Thanks 🎉 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants