Skip to content

Commit

Permalink
fix(community-side-navigation): fix uglified js issue with onclick
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-K-Lam committed Jan 10, 2019
1 parent 81e4493 commit c32fb4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/SideNavigation/SideNavigation.jsx
Expand Up @@ -153,7 +153,7 @@ class SideNavigation extends Component {
const id = `TDS-SideNavigation-${index}`
if (child.type.name === 'SubMenu') {
options = {
onClick: this.toggleOpen,
onSubMenuClick: this.toggleOpen,
isOpen: this.checkAccordion(id),
active: child.props.active,
id,
Expand Down
8 changes: 4 additions & 4 deletions packages/SideNavigation/SubMenu/SubMenu.jsx
Expand Up @@ -15,7 +15,7 @@ import styles from './SubMenu.scss'
*
* _This component can only be accessed as a name-spaced component: `SideNavigation.SubMenu`._
*/
const SubMenu = ({ children, label, onClick, id, isOpen, active }) => {
const SubMenu = ({ children, label, onSubMenuClick, id, isOpen, active }) => {
const options = {
subMenuLink: true,
}
Expand All @@ -24,7 +24,7 @@ const SubMenu = ({ children, label, onClick, id, isOpen, active }) => {
<div className={styles.mainDiv}>
<button
onClick={() => {
onClick(id)
onSubMenuClick(id)
}}
className={active ? styles.active : styles.buttonDefault}
>
Expand Down Expand Up @@ -62,7 +62,7 @@ SubMenu.propTypes = {
*
* @ignore
*/
onClick: PropTypes.func,
onSubMenuClick: PropTypes.func,
/**
* ID of the SubMenu, must be unique when using multiple SubMenus within the same SideNavigation component.
* @ignore
Expand All @@ -81,7 +81,7 @@ SubMenu.propTypes = {
}

SubMenu.defaultProps = {
onClick: undefined,
onSubMenuClick: undefined,
isOpen: false,
active: false,
children: undefined,
Expand Down
Expand Up @@ -177,6 +177,7 @@ exports[`SideNavigation renders 1`] = `
isOpen={false}
label="Threefdsfdsfds"
onClick={[Function]}
onSubMenuClick={[Function]}
>
<div
className="mainDiv"
Expand Down Expand Up @@ -316,6 +317,7 @@ exports[`SideNavigation renders without vertical spacing 1`] = `
isOpen={true}
label="Threefdsfdsfds"
onClick={[Function]}
onSubMenuClick={[Function]}
>
<div
className="mainDiv"
Expand Down

0 comments on commit c32fb4c

Please sign in to comment.