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] Update menu implementation on left nav #2421

Merged
merged 1 commit into from
Dec 8, 2015

Conversation

newoga
Copy link
Contributor

@newoga newoga commented Dec 8, 2015

This pull request is in support of deprecating the old menu components. (related to #2395, #2307)

It replaces the menu implementation on the left nav on the docs site with the new one.

As a result, it also fixes #1514

@newoga
Copy link
Contributor Author

newoga commented Dec 8, 2015

Note: I also change the zIndex of the header from 6 to 15 because the menu has a default zIndex of 10. I figured it'd be better to change the header so that components in the code examples don't go over the header which I've seen reported in other issues.

@newoga newoga changed the title Implement new menu implementation on docs left nav [Doc] Implement new menu implementation on docs left nav Dec 8, 2015
@newoga newoga changed the title [Doc] Implement new menu implementation on docs left nav [Doc] Update menu implementation on left nav Dec 8, 2015
@alitaheri
Copy link
Member

👍 Nice work. @oliviertassinari Please review and don't mind the code-style (const, extra empty line, etc...) I'm working on them. merge this if it's semantically alright.

onItemTouchTap={this._handleItemTouchTap}
openDirection="bottom-right"
style={styles.secondaryNav}
valueLink={{
Copy link
Member

Choose a reason for hiding this comment

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

React plan to deprecate valueLink.
Could we not use this property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't know valueLink was being deprecated...I'm not a huge fan of it anyway :P

Was just implementing it the easiest way I saw possible from the menu docs, I'll find another way.

Copy link
Member

Choose a reason for hiding this comment

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

Have a look at facebook/react#5032. This will help

@oliviertassinari
Copy link
Member

@newoga Thanks for working on this. That's an excellent idea!

@oliviertassinari oliviertassinari added the PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI label Dec 8, 2015
@newoga
Copy link
Contributor Author

newoga commented Dec 8, 2015

Hey @oliviertassinari,

I just pushed a new commit with your fixes/suggestions. I think the best way to implement the active route on page load is to pass the router's location down to the navbar component through props so that it is more stateless. It resulted in having to modify the page and master components.

I originally implemented this by looking at window.location.hash, but I think using the router location is the cleaner approach.

Let me know what you think!

@oliviertassinari
Copy link
Member

@newoga This works great, thanks!

I just had another idea. I don't know if you are going to like it.
I think that we should group component by type. For instance, we could creat a Form group
with the SelectField and the TextField. In this case, Using a List may be more appropriate.
Similary to https://www.google.com/design/spec/components/tabs.html.
I also think that this left panel should be in a LeftNav, again, using a List over a Menu would probably makes more sens 😁.

Still, I can merge this PR, since it's already far better.

@alitaheri
Copy link
Member

@oliviertassinari Should we discuss this with others in a separate issue? I mean the categorization is a big decision, this PR handles something else imo. 😬

@oliviertassinari
Copy link
Member

@subjectix Alright.
@newoga Could you squash down the commit, I will merge!

@oliviertassinari oliviertassinari added Review: accepted and removed PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI labels Dec 8, 2015
@newoga
Copy link
Contributor Author

newoga commented Dec 8, 2015

Haha, that's irony for you! I feel like I've been switching from List to Menu to List a lot lately 😝 That being said, I do agree that using the LeftNav would be preferable. Initially I was just trying to do the least amount of work to remove the old Menu just so we can drop it as a dependency.

I'll squash and can create a new issue for <PageWithNav /> improvements so that we can discuss more.

(Don't feel bad about suggesting a different approach, I certainly don't mind iterating and definitely prefer getting things right the first time. Worst case scenario I'll flip my table and no one will have to know 😄)

oliviertassinari added a commit that referenced this pull request Dec 8, 2015
[Doc] Update menu implementation on left nav
@oliviertassinari oliviertassinari merged commit 50e8288 into mui:master Dec 8, 2015
@oliviertassinari
Copy link
Member

@newoga Thanks

@alitaheri
Copy link
Member

@newoga Thanks a lot 👍 👍 🎉

@newoga newoga deleted the page-with-nav-new-menu branch December 9, 2015 00:18
@@ -142,7 +142,7 @@ const Master = React.createClass({
height: 64,
top: 0,
right: 0,
zIndex: 6,
zIndex: 15,
Copy link
Member

Choose a reason for hiding this comment

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

Why changing this?

Copy link
Member

Choose a reason for hiding this comment

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

I see, I have another issue with zIndex now.
I'm gonna fix it.

@zannager zannager added the component: menu This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Menu item can not remove hover background-color when mouseout.
4 participants