File tree Expand file tree Collapse file tree 3 files changed +7
-14
lines changed
Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Original file line number Diff line number Diff line change 11import React from "react" ;
22import { Container } from "theme-ui" ;
3- import { Redirect , Route , Switch } from "react-router-dom" ;
3+ import { Route , Switch } from "react-router-dom" ;
44import { Search } from "src/pages/Search" ;
5- import { Stats } from "src/pages/Stats" ;
65import { SearchDetail } from "src/pages/SearchDetail" ;
76import { Reserve } from "src/pages/Reserve" ;
87import { Extend } from "src/pages/Extend" ;
@@ -23,24 +22,18 @@ const App: React.FC = () => {
2322 < Header />
2423 < Switch >
2524 < Route exact path = "/" >
26- < Redirect to = "/search" />
27- </ Route >
28- < Route exact path = "/search" >
2925 < Search />
3026 </ Route >
31- < Route exact path = "/stats" >
32- < Stats />
33- </ Route >
34- < Route exact path = "/search/:name" >
27+ < Route exact path = "/:name" >
3528 < SearchDetail />
3629 </ Route >
37- < Route exact path = "/search/ :name/reserve" >
30+ < Route exact path = "/:name/reserve" >
3831 < Reserve />
3932 </ Route >
40- < Route exact path = "/search/ :name/request" >
33+ < Route exact path = "/:name/request" >
4134 < Request />
4235 </ Route >
43- < Route exact path = "/search/ :name/extend" >
36+ < Route exact path = "/:name/extend" >
4437 < Extend />
4538 </ Route >
4639 </ Switch >
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export const SearchBar: React.FC<IProps> = ({ size }) => {
5454 onSubmit = { ( e ) => {
5555 const searchTerm = searchInput ?. current . value ;
5656 if ( searchTerm && searchTerm !== "" ) {
57- history . push ( `/search/ ${ searchTerm } ` ) ;
57+ history . push ( `/${ searchTerm } ` ) ;
5858 }
5959 e . preventDefault ( ) ;
6060 } }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import { Provider } from "react-redux";
1212import store from "src/state" ;
1313import theme from "src/theme" ;
1414import { ThemeProvider } from "theme-ui" ;
15- import { HashRouter as Router } from "react-router-dom" ;
15+ import { BrowserRouter as Router } from "react-router-dom" ;
1616
1717import App from "./App" ;
1818import * as serviceWorker from "./serviceWorker" ;
You can’t perform that action at this time.
0 commit comments