Enforce Dupes Clause and Shiny Clause rules
Dupes Clause greys out Pokemon in the encounter modal whose evolution family has already been caught, preventing duplicate selections. Shiny Clause adds a dedicated Shiny Box and lets shiny catches bypass the one-per-route lock via a new is_shiny column on encounters and a /pokemon/families endpoint that computes evolution family groups. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { getPokemon } from '../api/pokemon'
|
||||
import { getPokemon, fetchPokemonFamilies } from '../api/pokemon'
|
||||
|
||||
export function usePokemon(id: number | null) {
|
||||
return useQuery({
|
||||
@@ -8,3 +8,11 @@ export function usePokemon(id: number | null) {
|
||||
enabled: id !== null,
|
||||
})
|
||||
}
|
||||
|
||||
export function usePokemonFamilies() {
|
||||
return useQuery({
|
||||
queryKey: ['pokemon', 'families'],
|
||||
queryFn: fetchPokemonFamilies,
|
||||
staleTime: Infinity,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user