Skip to content

Commit

Permalink
feat(community-side-navigation): enhancements to side nav
Browse files Browse the repository at this point in the history
added spacing below side nav, add space above and below tier 3, add drop down motion
  • Loading branch information
Andrew-K-Lam authored and jraff committed Mar 22, 2019
1 parent 9e59a68 commit 9da1782
Show file tree
Hide file tree
Showing 10 changed files with 490 additions and 131 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 69 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/SideNavigation/SideNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SideNavigation extends Component {
sideNav.style.width = `${parentWidth}px`
}

toggleOpen = id => {
toggleSubMenu = id => {
if (this.checkAccordion(id, this.state.accordion)) {
const array = [...this.state.open]
const index = array.indexOf(id)
Expand Down Expand Up @@ -112,7 +112,7 @@ class SideNavigation extends Component {
React.Children.map(this.props.children, (child, index) => {
const id = `TDS-SideNavigation-${index}`
if (!('href' in child.props) && child.props.active) {
this.toggleOpen(id)
this.toggleSubMenu(id)
}
})
}
Expand Down Expand Up @@ -154,7 +154,7 @@ class SideNavigation extends Component {
// check if href is in props to figure out if child is SubMenu or Link
if (!('href' in child.props)) {
options = {
onClick: this.toggleOpen,
handleToggleSubMenu: this.toggleSubMenu,
isOpen: this.checkAccordion(id),
active: child.props.active,
id,
Expand Down
2 changes: 2 additions & 0 deletions packages/SideNavigation/SideNavigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ $desktop: (
@mixin spacingClasses ($level, $mobileValue, $desktopValue) {
.verticalPadding-#{$level} {
padding-top: $mobileValue;
padding-bottom: $mobileValue;
@include mq($from: md) {
padding-top: $desktopValue;
padding-bottom: $desktopValue;
}
}
}
Expand Down
Loading

0 comments on commit 9da1782

Please sign in to comment.