-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add disable state for the links in Nav component (#8120)
* Add disable state for links in Nav component * Add disable state for links in Nav component * Nav Links Disable State: Add story to Nav.stories * Make changes after review * Remove IconNames due to depracation
- Loading branch information
1 parent
ecc7f0d
commit 7ddc1ee
Showing
12 changed files
with
1,245 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...on/changes/office-ui-fabric-react/issue-7835_Nav_Link_Disable_State_2019-02-26-15-16.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "office-ui-fabric-react", | ||
"comment": "Nav: Add disable state for navigation links", | ||
"type": "minor" | ||
} | ||
], | ||
"packageName": "office-ui-fabric-react", | ||
"email": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
packages/office-ui-fabric-react/src/components/Nav/examples/Nav.DisabledItems.Example.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import * as React from 'react'; | ||
import { Nav, INavLink } from 'office-ui-fabric-react/lib/Nav'; | ||
import './Nav.Basic.Example.scss'; | ||
|
||
export class NavDisabledItemsExample extends React.Component<any, any> { | ||
public onLinkClick = (ev: React.MouseEvent<HTMLElement>, item?: INavLink) => { | ||
if (item && item.name === 'News') { | ||
alert('News link clicked'); | ||
} | ||
}; | ||
|
||
public render(): JSX.Element { | ||
return ( | ||
<div className="ms-NavExample-LeftPane"> | ||
<Nav | ||
groups={[ | ||
{ | ||
links: [ | ||
{ | ||
name: 'Home', | ||
url: 'http://example.com', | ||
disabled: true, | ||
links: [ | ||
{ | ||
name: 'Activity', | ||
url: 'http://msn.com', | ||
key: 'key1' | ||
}, | ||
{ | ||
name: 'MSN', | ||
url: 'http://msn.com', | ||
key: 'key2', | ||
disabled: true, | ||
altText: 'The link is temporary disabled' | ||
} | ||
], | ||
isExpanded: true | ||
}, | ||
{ | ||
name: 'Documents', | ||
url: 'http://example.com', | ||
key: 'key3' | ||
}, | ||
{ | ||
name: 'Unavailable Item', | ||
url: 'http://cnn.com', | ||
icon: 'News', | ||
disabled: true, | ||
key: 'key4' | ||
} | ||
] | ||
} | ||
]} | ||
onLinkClick={this.onLinkClick} | ||
expandedStateText={'expanded'} | ||
collapsedStateText={'collapsed'} | ||
selectedKey={'key3'} | ||
expandButtonAriaLabel={'Expand or collapse'} | ||
/> | ||
</div> | ||
); | ||
} | ||
} |
Oops, something went wrong.