diff --git a/src/App.css b/src/App.css index eb55118..f4bb3b5 100644 --- a/src/App.css +++ b/src/App.css @@ -16,7 +16,7 @@ img { user-drag: none; } -#root { +.app-layout { display: flex; flex-direction: row; align-items: stretch; @@ -27,7 +27,7 @@ img { box-sizing: border-box; } -#root > div { +.app-layout > div { border: 1px solid #ccc; padding: 10px; box-sizing: border-box; @@ -35,18 +35,18 @@ img { min-height: 0; } -#root > #pokemonList { +.app-layout > #pokemonList { order: 1; flex: 1; } -#root > #pokemonCard { +.app-layout > #pokemonCard { order: 2; flex: 2; flex-direction: column; } -#root > #favoritePokemon { +.app-layout > #favoritePokemon { order: 3; flex: 1; } @@ -77,12 +77,6 @@ input { justify-content: center; } -#sorting { -} - -#favorite { -} - @media (max-width: 1000px) { body { -ms-overflow-style: none; /* Internet Explorer 10+ */ @@ -90,14 +84,14 @@ input { overflow: scroll; } - #root { + .app-layout { flex-direction: column; width: 100%; height: auto; align-items: stretch; } - #root > div { + .app-layout > div { flex: 0 0 auto !important; width: 100% !important; height: auto !important; diff --git a/src/App.tsx b/src/App.tsx index 54a745b..8575346 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,6 +5,7 @@ import { getPokemonByID } from "./api/pokemon"; import { PokemonCard } from "./components/PokemonCard/PokemonCard"; import { Favorite } from "./components/Favorite/Favorite"; import { useFavorites } from "./controllers/useFavorites"; +import { useFilters } from "./controllers/useFilters"; import { PokemonList } from "./components/PokemonList/PokemonList"; import { FavoritePokemon } from "./components/FavoritePokemon/FavoritePokemon"; @@ -12,6 +13,7 @@ export default function App() { const [currentId, setCurrentId] = useState(1); const { favoritePokemons, isFavorite, toggleFavorite, isLoadingFavorites } = useFavorites(); + const { filters } = useFilters(); const query = useQuery({ queryKey: ["pokemon", currentId], @@ -34,7 +36,7 @@ export default function App() { }; return ( -
Loading...
} + {query.isError &&Failed to load Pokemon
} {query.data &&