-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul Pacurar
committed
Oct 3, 2021
1 parent
9015d9b
commit 32d3f2e
Showing
10 changed files
with
110 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
body { | ||
background-color: black; | ||
color: cyan; | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | ||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", | ||
monospace; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,34 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import "./index.css"; | ||
import App from "./App"; | ||
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"; | ||
import reportWebVitals from "./reportWebVitals"; | ||
import PokemonList from "./components/pokemon-list"; | ||
import Pokemon from "./components/pokemon"; | ||
import Login from "./components/login"; | ||
import reduxStore from "./store"; | ||
import { Provider } from "react-redux"; | ||
|
||
const Routing = () => { | ||
return ( | ||
<Router> | ||
<Switch> | ||
<Route exact path="/" component={PokemonList} /> | ||
<Route exact path="/pokemon" component={PokemonList} /> | ||
<Route exact path="/pokemon/:id" component={Pokemon} /> | ||
<Route exact path="/login" component={Login} /> | ||
</Switch> | ||
</Router> | ||
); | ||
}; | ||
const Routing = () => ( | ||
<Router> | ||
<Switch> | ||
<Route exact path="/" component={PokemonList} /> | ||
<Route exact path="/pokemon" component={PokemonList} /> | ||
<Route exact path="/pokemon/:id" component={Pokemon} /> | ||
<Route exact path="/login" component={Login} /> | ||
</Switch> | ||
</Router> | ||
); | ||
|
||
const token = localStorage.getItem("token"); | ||
if (token) { | ||
reduxStore.auth = { token, username: localStorage.getItem("username") }; | ||
} | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<Provider store={reduxStore}> | ||
<App> | ||
<Routing /> | ||
</App> | ||
<Routing /> | ||
</Provider> | ||
</React.StrictMode>, | ||
document.getElementById("root"), | ||
); | ||
|
||
// If you want to start measuring performance in your app, pass a function | ||
// to log results (for example: reportWebVitals(console.log)) | ||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals | ||
reportWebVitals(); |