diff --git a/package-lock.json b/package-lock.json index 993b456..5c53e74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12099,11 +12099,11 @@ "integrity": "sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg==" }, "react-router": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", - "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.1.tgz", + "integrity": "sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==", "requires": { - "@babel/runtime": "^7.1.2", + "@babel/runtime": "^7.12.13", "history": "^4.9.0", "hoist-non-react-statics": "^3.1.0", "loose-envify": "^1.3.1", @@ -12136,15 +12136,15 @@ } }, "react-router-dom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", - "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.3.0.tgz", + "integrity": "sha512-ObVBLjUZsphUUMVycibxgMdh5jJ1e3o+KpAZBVeHcNQZ4W+uUGGWsokurzlF4YOldQYRQL4y6yFRWM4m3svmuQ==", "requires": { - "@babel/runtime": "^7.1.2", + "@babel/runtime": "^7.12.13", "history": "^4.9.0", "loose-envify": "^1.3.1", "prop-types": "^15.6.2", - "react-router": "5.2.0", + "react-router": "5.2.1", "tiny-invariant": "^1.0.2", "tiny-warning": "^1.0.0" } diff --git a/package.json b/package.json index a154f9e..c16ceb8 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "prop-types": "^15.7.2", "react": "^17.0.1", "react-dom": "^17.0.1", - "react-router-dom": "^5.2.0", + "react-router-dom": "^5.3.0", "react-scripts": "4.0.3", "sass": "^1.32.11", "web-vitals": "^1.0.1" diff --git a/src/App.js b/src/App.js index 3a49c0e..268c45a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,9 +1,26 @@ import React from "react"; +import { + BrowserRouter as Router, + Switch, + Route +} from "react-router-dom"; +import Character from "./pages/Character/Character"; +import Episode from "./pages/Episode/Episode"; +import Location from "./pages/Location/Location"; import Home from "./pages/Home"; function App() { - return ; + return ( + + + + + + + + + ) } export default App; diff --git a/src/components/CharacterCard/CharacterCard.js b/src/components/CharacterCard/CharacterCard.js index 9e7e4ab..5e40180 100644 --- a/src/components/CharacterCard/CharacterCard.js +++ b/src/components/CharacterCard/CharacterCard.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import React from "react"; import { Link } from "react-router-dom"; @@ -5,17 +6,30 @@ import "./CharacterCard.scss"; import * as routes from "../../constants/routes"; -function CharacterCard({ id, name, image, species, status, origin, location }) { +function CharacterCard({ + characterId, + name, + image, + species, + status, + origin, + location, +}) { + console.log(location); + let locationId = location.split("/"); + locationId = locationId[locationId.length -1]; + console.log(locationId); + return (
- +

{name}

{origin.name} diff --git a/src/components/EpisodeCard/EpisodeCard.js b/src/components/EpisodeCard/EpisodeCard.js index 13cb5cf..02e466e 100644 --- a/src/components/EpisodeCard/EpisodeCard.js +++ b/src/components/EpisodeCard/EpisodeCard.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, {} from "react"; import { Link } from "react-router-dom"; import "./EpisodeCard.scss"; @@ -6,6 +6,8 @@ import "./EpisodeCard.scss"; import * as routes from "../../constants/routes"; function EpisodeCard({ id, name, airDate, episode }) { + + return (
diff --git a/src/components/Footer/Footer.js b/src/components/Footer/Footer.js index 8ed7b26..3cdfe28 100644 --- a/src/components/Footer/Footer.js +++ b/src/components/Footer/Footer.js @@ -8,6 +8,7 @@ function Footer() {

Assembler School © {new Date().getFullYear()}

+
diff --git a/src/components/Layout/Layout.js b/src/components/Layout/Layout.js index a8bdcd3..2aa0690 100644 --- a/src/components/Layout/Layout.js +++ b/src/components/Layout/Layout.js @@ -9,6 +9,7 @@ function Layout({ children }) { <>
{children}
+