diff --git a/docs/src/app/components/pages/components/left-nav.jsx b/docs/src/app/components/pages/components/left-nav.jsx index 534612fc2736b1..71578d0852a812 100644 --- a/docs/src/app/components/pages/components/left-nav.jsx +++ b/docs/src/app/components/pages/components/left-nav.jsx @@ -11,7 +11,7 @@ export default class LeftNavPage extends React.Component { super(); this._showLeftNavClick = this._showLeftNavClick.bind(this); this._toggleDockedLeftNavClick = this._toggleDockedLeftNavClick.bind(this); - + this._showLeftNavChildrenClick = this._showLeftNavChildrenClick.bind(this); this.state = { isDocked: false, }; @@ -28,6 +28,12 @@ export default class LeftNavPage extends React.Component { { type: MenuItem.Types.LINK, payload: 'https://www.google.com', text: 'Disabled Link', disabled: true }, ]; + let menuComponents = [ +
Get Started
, +
Customization
, + , + ]; + let componentInfo = [ { name: 'Props', @@ -56,7 +62,7 @@ export default class LeftNavPage extends React.Component { { name: 'menuItems', type: 'array', - header: 'required', + header: 'optional', desc: 'JSON data representing all menu items to render.', }, { @@ -143,10 +149,18 @@ export default class LeftNavPage extends React.Component { componentInfo={componentInfo}>
-

- +
+

+

+

+
+ + + Menu Item + Link +
@@ -156,7 +170,9 @@ export default class LeftNavPage extends React.Component { _showLeftNavClick() { this.refs.leftNav.toggle(); } - + _showLeftNavChildrenClick() { + this.refs.leftNavChildren.toggle(); + } _toggleDockedLeftNavClick() { this.refs.dockedLeftNav.toggle(); this.setState({ diff --git a/docs/src/app/components/raw-code/left-nav-code.txt b/docs/src/app/components/raw-code/left-nav-code.txt index 12ff19d6023893..4e77ce37e73da3 100644 --- a/docs/src/app/components/raw-code/left-nav-code.txt +++ b/docs/src/app/components/raw-code/left-nav-code.txt @@ -28,3 +28,9 @@ this.refs.leftNav.toggle(); //Hideable Left Nav + +//Hideable Left Nav with Nested Children + + Menu Item + Link + diff --git a/src/left-nav.jsx b/src/left-nav.jsx index afac394473c5bd..ff04bcace904b4 100644 --- a/src/left-nav.jsx +++ b/src/left-nav.jsx @@ -42,7 +42,7 @@ const LeftNav = React.createClass({ disableSwipeToOpen: React.PropTypes.bool, docked: React.PropTypes.bool, header: React.PropTypes.element, - menuItems: React.PropTypes.array.isRequired, + menuItems: React.PropTypes.array, onChange: React.PropTypes.func, onNavOpen: React.PropTypes.func, onNavClose: React.PropTypes.func, @@ -181,7 +181,25 @@ const LeftNav = React.createClass({ onTouchTap={this._onOverlayTouchTap} /> ); } - + let children; + if (this.props.menuItems === undefined) { + children = this.props.children; + } + else { + children = + } return (
{overlay} @@ -195,19 +213,8 @@ const LeftNav = React.createClass({ this.props.openRight && styles.rootWhenOpenRight, this.props.style)}> {this.props.header} - + + {children}
);