From d58044032f806038efc191ee61bd8a9698423f1b Mon Sep 17 00:00:00 2001 From: Danna Cardenas Date: Tue, 1 Feb 2022 22:39:08 -0500 Subject: [PATCH] Se corrige bug de vista detalles desde favs --- src/App.js | 2 +- src/components/navbar.jsx | 4 ++-- src/components/pages/details.jsx | 2 ++ src/components/pokelist.jsx | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/App.js b/src/App.js index 1ffc4c9..d3e4b51 100644 --- a/src/App.js +++ b/src/App.js @@ -17,7 +17,7 @@ function App() { } /> - } /> + } /> } /> {/* } /> */} diff --git a/src/components/navbar.jsx b/src/components/navbar.jsx index 5848463..50a2af7 100644 --- a/src/components/navbar.jsx +++ b/src/components/navbar.jsx @@ -43,8 +43,8 @@ const ResponsiveAppBar = () => { const navigateToRepo_ = (e) => { const { value } = e.target.innerText; - if (e.target.innerText === 'Repositories'){ - navigateTo('/pokemon'); + if (e.target.innerText === 'Pokémon'){ + navigateTo('/'); } else if (e.target.innerText=== 'Favorites') { navigateTo('/favorites'); diff --git a/src/components/pages/details.jsx b/src/components/pages/details.jsx index b70de48..90e8a0e 100644 --- a/src/components/pages/details.jsx +++ b/src/components/pages/details.jsx @@ -1,3 +1,4 @@ +import ResponsiveAppBar from "../navbar" import Pokedetails from "../pokedetails" @@ -6,6 +7,7 @@ function Details({pokemon, dispatch}) { return ( <> +

Vista detalles

diff --git a/src/components/pokelist.jsx b/src/components/pokelist.jsx index e29338d..804d7af 100644 --- a/src/components/pokelist.jsx +++ b/src/components/pokelist.jsx @@ -21,7 +21,7 @@ function Pokelist({ favs, data, page, pageSize, dispatch }) { function handleClick(e) { const id = e.currentTarget.value console.log('id', id) - navigateTo(`details/${id}`); + navigateTo(`/${id}`); } return (