Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0ab630c

Browse files
committedDec 21, 2019
Fix lint errors
1 parent 3a9217e commit 0ab630c

File tree

5 files changed

+17
-22
lines changed

5 files changed

+17
-22
lines changed
 

‎dist/dev/index.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/prod/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/components/AccountMenu/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class AccountMenu extends React.Component {
4141

4242
render () {
4343
const {
44-
onClose, onClickNotifications, numNotifications, open, menu, switchText, onSwitch, profile
44+
onClose, open, menu, switchText, onSwitch, profile
4545
} = this.props
4646

4747
return (
@@ -82,7 +82,7 @@ class AccountMenu extends React.Component {
8282
onClick={onSwitch}
8383
>
8484
<IconSwitchBusiness className={styles['switch-icon']} />
85-
<Link to={hasAccess(profile.roles)? _.isEmpty(switchText.href) ? switchText.link : switchText.href : 'http://www.topcoder.com'} onClick={onClose}>
85+
<Link to={hasAccess(profile.roles) ? _.isEmpty(switchText.href) ? switchText.link : switchText.href : 'http://www.topcoder.com'} onClick={onClose}>
8686
<span className={styles['switch-to-busniness']}>{switchText.title}</span>
8787
</Link>
8888
</div>
@@ -112,8 +112,6 @@ AccountMenu.propTypes = {
112112
onClose: PropTypes.func,
113113
menu: PropTypes.array,
114114
switchText: PropTypes.shape(),
115-
numNotifications: PropTypes.number,
116-
onClickNotifications: PropTypes.func,
117115
onSwitch: PropTypes.func,
118116
profile: PropTypes.shape()
119117
}

‎src/components/TopNav/index.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ const TopNav = ({
350350
let found = { m1: null, m2: null, m3: null }
351351

352352
// If haven't a path just return
353-
if(!path_) return found
353+
if (!path_) return found
354354

355355
menuWithId_.forEach(level1 => {
356356
if (level1.href && path_.indexOf(level1.href) > -1) found = { m1: level1.id, m2: null }
@@ -363,14 +363,14 @@ const TopNav = ({
363363
} else {
364364
found = { m1: level1.id, m2: level2.id, m3: level3.id }
365365
}
366-
if(!activeLevel3Id && level3.collapsed) setforceHideLevel3(true)
366+
if (!activeLevel3Id && level3.collapsed) setforceHideLevel3(true)
367367
}
368368
})
369369
})
370370
level1.secondaryMenu && level1.secondaryMenu.forEach(level3 => {
371371
if (level3.href) {
372372
// Check if path have parameters
373-
const href = level3.href.indexOf("?") > -1 ? level3.href.split("?")[0] : level3.href;
373+
const href = level3.href.indexOf('?') > -1 ? level3.href.split('?')[0] : level3.href
374374
if (path_.indexOf(href) > -1) found = { m1: level1.id, m3: level3.id }
375375
}
376376
})
@@ -384,25 +384,22 @@ const TopNav = ({
384384
// always expand menu on challenge list page and challenge details page
385385
// also in challenge details page, level 3 menu shouldnt be visible if (!path || !menuWithId[0]) return
386386
const { m1, m2 } = getMenuIdsFromPath(menuWithId, path)
387-
let forceExpand = false
388387
let forceM2 = null
389388

390389
if (path.indexOf('/challenges') > -1) {
391390
// If All Challenge page
392-
forceExpand = true
393391
if (path.match(/challenges\/[0-9]+/)) {
394392
// If Challenge Details page
395393
setforceHideLevel3(true)
396-
forceExpand = true
397394
forceM2 = getMenuIdsFromPath(menuWithId, '/challenges').m2
398395
}
399-
} else if (path.indexOf('/my-dashboard') > -1 || path.indexOf('/members/'+profileHandle) > -1) {
396+
} else if (path.indexOf('/my-dashboard') > -1 || path.indexOf('/members/' + profileHandle) > -1) {
400397
// If My Dashboard and My Profile page
401398
setShowLevel3(true)
402399
} else if (path.indexOf('/community/learn') > -1 || path.indexOf('/thrive/tracks') > -1) {
403400
// Show 3rd level menu to Community [ Overview - How It Works ]
404-
forceM2 = getMenuIdsFromPath(menuWithId, '/community').m2;
405-
} else if(!m2) {
401+
forceM2 = getMenuIdsFromPath(menuWithId, '/community').m2
402+
} else if (!m2) {
406403
setShowLevel3(false)
407404
setforceHideLevel3(true)
408405
}

‎src/components/UserInfo/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const UserInfo = ({ profile, onClick, open, newNotifications }) => (
2121
<div className={styles.handleContainer}>
2222
<span className={styles.handle}>{_.isEmpty(profile) ? '' : profile.handle}</span>
2323
<span className={styles.dropdownIcon}>
24-
{ open? <IconArrowSmallup /> : <IconArrowSmalldown /> }
24+
{ open ? <IconArrowSmallup /> : <IconArrowSmalldown /> }
2525
</span>
2626
</div>
2727
</div>

0 commit comments

Comments
 (0)