-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Conversation
@@ -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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, sorry. on it.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing. 👍
@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 = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
maybe?
You must have seen that Remarque regarding the documentation:
|
@oliviertassinari Thanks for the review. I will fix them asap. And regarding
You already did this 😁
I will try to think of something. 👍 |
@oliviertassinari Please review again. I think coding styles must be kept consistent, I did some aggressive changes 😈 |
That's pretty agressive indeed. |
@@ -46,21 +67,33 @@ const Toolbar = React.createClass({ | |||
return this.state.muiTheme.toolbar; | |||
}, | |||
|
|||
getStyles() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep it?
There was a problem hiding this comment.
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.
@oliviertassinari Please check again |
@@ -46,21 +67,36 @@ const Toolbar = React.createClass({ | |||
return this.state.muiTheme.toolbar; | |||
}, | |||
|
|||
getSpacing() { |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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.
@subjectix Thanks |
[Doc] Convert Toolbars to use the new standard.
Thanks 🎉 🎉 |
@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 toToolbarTitle
to ensure consistency and migrated frommenu
tomenus
. Please review.One last thing to note. seems like the new
menus
cannot be corretly positioned in aToolbar
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.