Skip to content

Commit

Permalink
Merge pull request #49 from pranay-sharma793/main
Browse files Browse the repository at this point in the history
switch case change for key handling
  • Loading branch information
SaharMehrpour authored Sep 23, 2024
2 parents 970345e + 8b31f83 commit d6e43a1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/ui/navBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ export class NavBar extends Component {
<Navbar.Collapse>
<Nav
onSelect={(key) => {
if (key > 0) {
window.location.hash = (key === 1) ? `#/${hashConst.index}` : (key === 2) ? `#/${hashConst.rules}` :
(key === 3) ? `#/${hashConst.violatedRules}` : (key === 4) ? `#/${hashConst.learnDesignRules}` : `#/${hashConst.index}`;
}
const hashRoutes = {
1: `#/${hashConst.index}`,
2: `#/${hashConst.rules}`,
3: `#/${hashConst.violatedRules}`,
4: `#/${hashConst.learnDesignRules}`,
};

window.location.hash = hashRoutes[key] || `#/${hashConst.index}`;
}}>

<NavItem eventKey={1}>
Expand Down

0 comments on commit d6e43a1

Please sign in to comment.