Update routes

This commit is contained in:
Hazem Krimi
2020-10-16 14:10:32 +01:00
parent a6c406fbcf
commit 53f8b1734f
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
"styled-components": "^5.2.0", "styled-components": "^5.2.0",
"typescript": "~3.7.2" "typescript": "~3.7.2"
}, },
"homepage": "https://hazemkrimi.github.io/react-weather-app", "homepage": "https://hazemkrimi.github.io/react-weather-app/home",
"scripts": { "scripts": {
"start": "react-scripts start", "start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
+3
View File
@@ -20,6 +20,9 @@ const App: React.FC = () => {
<Route path='/' exact> <Route path='/' exact>
<Home /> <Home />
</Route> </Route>
<Route path='/home' exact>
<Home />
</Route>
<Route path='/search/:query'> <Route path='/search/:query'>
<Search /> <Search />
</Route> </Route>
+1 -1
View File
@@ -20,7 +20,7 @@ const NavBar: React.FC = () => {
return ( return (
<Nav> <Nav>
<h1 onClick={() => history.push('/')}>Weather</h1> <h1 onClick={() => history.push('/home')}>Weather</h1>
<SearchBar /> <SearchBar />
</Nav> </Nav>
); );