Skip to content

Commit cace0a8

Browse files
Append to current url (router fix)
1 parent de8f281 commit cace0a8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

algorithm_visualizer/src/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const App = () => {
88
<Router>
99
<Switch>
1010
<Route exact path="/" component={LandingPage}/>
11-
<Route path="/AlgorithmVisualizer/#/sorting" component={SortingPage}/>
12-
<Route path="/AlgorithmVisualizer/#/graph" component={GraphPage}/>
11+
<Route path="/sorting" component={SortingPage}/>
12+
<Route path="/graph" component={GraphPage}/>
1313
</Switch>
1414
</Router>
1515
);

algorithm_visualizer/src/pages/LandingPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export const LandingPage = () => {
77
<div className="landingPage bubbles">
88
{/* Navigation Buttons to Algorithms Visualizers */}
99
<div id="navigation">
10-
<button className="btn" onClick={event => window.location.href='/sorting'}>Sorting</button>
11-
<button className="btn" onClick={event => window.location.href='/graph'}>Graphs</button>
10+
<button className="btn" onClick={event => window.location.href+='/sorting'}>Sorting</button>
11+
<button className="btn" onClick={event => window.location.href+='/graph'}>Graphs</button>
1212
</div>
1313

1414
{/* Title*/}

0 commit comments

Comments
 (0)