-
Notifications
You must be signed in to change notification settings - Fork 2.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
Add disable state for the links in Nav component #8120
Add disable state for the links in Nav component #8120
Conversation
This is awesome @winperec! Thanks so much for tackling this work. :) Just one request, would you mind adding a visual regression test in Nav.stories.tsx? It might look something like this: .addStory(
'Disabled',
() => (
<div style={{ width: '208px' }}>
<Nav
groups={[{ links: disabledLinks }]}
expandedStateText={'expanded'}
collapsedStateText={'collapsed'}
selectedKey={'key3'}
/>
</div>
),
{ rtl: true }
); where |
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.
Looks great! I left comments on some minor things.
{ | ||
name: 'Unavailable Item', | ||
url: 'http://cnn.com', | ||
icon: 'News', |
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 make this IconNames.News
?
packages/office-ui-fabric-react/src/components/Nav/examples/Nav.DisabledItems.Example.tsx
Outdated
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/Nav/examples/Nav.DisabledItems.Example.tsx
Show resolved
Hide resolved
packages/office-ui-fabric-react/src/components/Nav/examples/Nav.DisabledItems.Example.tsx
Outdated
Show resolved
Hide resolved
{ | ||
name: 'Unavailable Item', | ||
url: 'http://cnn.com', | ||
icon: 'News', | ||
icon: IconNames.News, |
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're right about the deprecation of IconNames, good catch. We can change this back to 'News' like you had before.
icon: IconNames.News, | |
icon: 'News', |
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 following solution can work for OTB constant icons
https://gist.github.com/winperec/052cba5e7fcb563ab92ccc8ae2f0b1bb
but I think Office UI Fabric supports registering custom icons and in this case it will not work :)
packages/office-ui-fabric-react/src/components/Nav/examples/Nav.Basic.Example.tsx
Show resolved
Hide resolved
@natalieethell Thanks for review! Looking forward to see it in next minor release and remove our local workarounds |
🎉 Handy links: |
Pull request checklist
$ npm run change
Description of changes
I've added disable state for the Nav links. Design is done using within existing concepts. This is how it looks like:
Also please review how it work in action:
Here we have example how disable works with
Focus areas to test
(optional)
Microsoft Reviewers: Open in CodeFlow