diff --git a/src/App.css b/src/App.css index 868e790..a3aab55 100644 --- a/src/App.css +++ b/src/App.css @@ -529,3 +529,29 @@ border-spacing: 4px; } } + +.arrow-navigation { + display: flex; + align-items: center; + justify-content: center; + gap: 12px; +} + +.arrow-navigation button { + padding: 10px 18px; + border: none; + border-radius: 999px; + background: var(--accent); + color: white; + font-weight: bold; + cursor: pointer; + transition: + transform 0.1s ease, + background 0.15s ease; +} + +.arrow-navigation button:hover, +.arrow-navigation button:focus-visible { + background: var(--accent-hover, #cc3f5a); + transform: translateY(-2px); +} diff --git a/src/App.tsx b/src/App.tsx index 3b15a09..af8c407 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,6 +5,7 @@ import FavoritesSidebar from './FavoritesSidebar'; import SearchBar, { SEARCH_STORAGE_KEY } from './SearchBar'; import { listAllPokemon } from './Api'; import PokemonDetails from './PokemonDetails'; +import ArrowNavigation from './ArrowNavigation'; import './App.css'; @@ -73,6 +74,11 @@ function App() { setSelectedPokemonId={setSelectedPokemonId} /> + +
diff --git a/src/ArrowNavigation.tsx b/src/ArrowNavigation.tsx new file mode 100644 index 0000000..dfd9eb9 --- /dev/null +++ b/src/ArrowNavigation.tsx @@ -0,0 +1,60 @@ +import type { Dispatch, SetStateAction } from 'react'; + +const MAX_POKEMON_ID = 1025; +const SPECIAL_POKEMON_START = 10001; +const SPECIAL_POKEMON_MAX = 10025; + +type ArrowNavigationProps = { + selectedPokemonId: number | null; + setSelectedPokemonId: Dispatch>; +}; + +function ArrowNavigation({ + selectedPokemonId, + setSelectedPokemonId, +}: ArrowNavigationProps) { + return ( +
+ {selectedPokemonId !== null && selectedPokemonId > 1 && ( + + )} + {selectedPokemonId !== null && + selectedPokemonId > 0 && + selectedPokemonId < SPECIAL_POKEMON_MAX && ( + + )} +
+ ); +} + +export default ArrowNavigation;