diff --git a/.pullapprove.yml b/.pullapprove.yml index f453aaab3c5f2..436823b4b391b 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -13,5 +13,6 @@ reviewers: - cliffkoh - aditima - yiminwu + - antonlabunets name: pullapprove required: 1 diff --git a/src/components/Nav/Nav.Props.ts b/src/components/Nav/Nav.Props.ts index 7da3d365c8d15..33febb0c728c1 100644 --- a/src/components/Nav/Nav.Props.ts +++ b/src/components/Nav/Nav.Props.ts @@ -21,16 +21,6 @@ export interface INavProps { * Indicates whether the navigation component renders on top of other content in the UI */ isOnTop?: boolean; - - /** - * (Optional) The alt text for the expanded state - **/ - expandedStateText?: string; - - /** - * (Optional) The alt text for the collapsed state text - **/ - collapsedStateText?: string; } export interface INavLinkGroup { diff --git a/src/components/Nav/Nav.scss b/src/components/Nav/Nav.scss index 4a5305615959f..f97675faa021f 100644 --- a/src/components/Nav/Nav.scss +++ b/src/components/Nav/Nav.scss @@ -39,52 +39,25 @@ transition: transform .1s linear; } -.ms-Nav-links { - display: block; - position: relative; - - .ms-Nav-chevronButton.ms-Nav-chevronButton--link { - display: block; - width: 40px; - height: 40px; - position: absolute; - top: 0; - @include left(0); - z-index: 1; - padding: 0; - margin: 0; - - .ms-Nav-chevron { - position: relative; - } - - &:hover { - background: transparent; - color: $ms-color-themePrimary; - } - } - - &.is-expanded { - .ms-Nav-chevron { - transform: rotate(-180deg); - } - } +.ms-Nav-IconLink { + @include margin-right(4px); } -.ms-Nav-chevronButton { +.ms-Nav-groupButton { display: block; + width: 100%; + height: 40px; + font-family: $ms-font-family-regular; font-size: $ms-font-size-s; @include text-align(left); line-height: 40px; margin: 5px 0; - padding-top: 0px; - @include padding-right(40px); - padding-bottom: 0px; - @include padding-left(40px); + padding: 0 40px; background: none; border: none; + border-bottom: 1px solid $dividerColor; text-transform: uppercase; cursor: pointer; @@ -99,15 +72,9 @@ color: $unselectedHoverForegroundColor; background: $unselectedHoverBackgroundColor; } - - &.ms-Nav-chevronButton--group { - width: 100%; - height: 40px; - border-bottom: 1px solid $dividerColor; - } } -.ms-Nav-chevron.ms-Icon { +.ms-Nav-groupChevron.ms-Icon { position: absolute; @include left(15px); height: 40px; @@ -116,25 +83,22 @@ transition: transform .1s linear; } -.ms-Nav-group.is-expanded .ms-Nav-chevronButton--group .ms-Nav-chevron { +.ms-Nav-group.is-expanded .ms-Nav-groupChevron { transform: rotate(-180deg); } -.ms-Nav-linkText { - vertical-align: middle; -} - .ms-Nav-link { display: block; position: relative; - padding-top: 10px; - @include padding-right(10px); - padding-bottom: 10px; - @include padding-left(40px); + height: 40px; + line-height: 40px; + text-decoration: none; + padding: 0 40px; cursor: pointer; - overflow: hidden; - word-wrap: break-word; + text-overflow: ellipsis; text-decoration: none; + white-space: nowrap; + overflow-x: hidden; color: $unselectedForegroundColor; background: $unselectedBackgroundColor; @@ -160,17 +124,13 @@ content: ''; position: absolute; top: 0; - @include right(0); + right: 0; bottom: 0; - @include left(0); + left: 0; } } } -.ms-Nav-chevronButton, -.ms-Nav-chevronButton--group, -.ms-Nav-chevronButton--link, -.ms-Nav-link { +.ms-Nav-groupButton, .ms-Nav-link { @include focus-border(); } - diff --git a/src/components/Nav/Nav.tsx b/src/components/Nav/Nav.tsx index a30931d8a69de..2941e036d999b 100644 --- a/src/components/Nav/Nav.tsx +++ b/src/components/Nav/Nav.tsx @@ -43,49 +43,31 @@ export class Nav extends React.Component { ); } - private _renderAnchorLink(link: INavLink): React.ReactElement<{}> { - return ( - { this.props.onRenderLink(link) } - ); - } - - private _renderCompositeLink(link: INavLink, linkIndex: number): React.ReactElement<{}> { - return ( -
- - { this._renderAnchorLink(link) } -
- ); - } - - private _renderLink(link: INavLink, linkIndex: number, level: number): React.ReactElement<{}> { + private _renderLink(link: INavLink, linkIndex: number): React.ReactElement<{}> { return (
  • - {(level === 0 && link.links && link.links.length > 0 ? - this._renderCompositeLink(link, linkIndex) : this._renderAnchorLink(link) - )} - { (link.isExpanded ? this._renderLinks(link.links, ++level) : null) } -
  • + + { (link.iconClassName ? + + : '') } + { this.props.onRenderLink(link)} + { this._renderLinks(link.links) } + ); } - private _renderLinks(links: INavLink[], level: number): React.ReactElement<{}> { + private _renderLinks(links: INavLink[]): React.ReactElement<{}> { if (!links || !links.length) { return null; } const linkElements: React.ReactElement<{}>[] = links.map( - (link: INavLink, linkIndex: number) => this._renderLink(link, linkIndex, level)); + (link: INavLink, linkIndex: number) => this._renderLink(link, linkIndex)); return (