diff --git a/src/components/InfoDialogComponent/InfoDialogComponent.tsx b/src/components/InfoDialogComponent/InfoDialogComponent.tsx index 10361a6..888b4ff 100644 --- a/src/components/InfoDialogComponent/InfoDialogComponent.tsx +++ b/src/components/InfoDialogComponent/InfoDialogComponent.tsx @@ -7,31 +7,18 @@ import { findPokeTypeAsset } from 'components/PokemonTypes'; import { colorTypeGradients } from 'components/utils'; import GenderRate from 'components/GenderRate'; import Delayed from 'components/Delayed'; -import EvolutionSpecies, { - EvolutionSpeciesProps, -} from 'components/EvolutionSpecies'; +import EvolutionSpecies from 'components/EvolutionSpecies'; +import { InfoDialogDetails } from 'features/InfoDialog/infoDialogSlice'; export interface Stat { stat__name: string; stat__value: number; } -export interface InfoDialogComponentProps { +export type InfoDialogComponentProps = InfoDialogDetails & { openDialog: boolean; closeDialog: () => void; - id: number; - name: string; - types: string[]; - genera: string; - image: string; - height: number; - weight: number; - genderRatio: number; - description: string; - abilities: string[]; - stats: Stat[]; - evolutionChain: EvolutionSpeciesProps[]; -} +}; const InfoDialog = ({ openDialog, diff --git a/src/features/InfoDialog/infoDialogSlice.ts b/src/features/InfoDialog/infoDialogSlice.ts index 9eee2be..f4c3b13 100644 --- a/src/features/InfoDialog/infoDialogSlice.ts +++ b/src/features/InfoDialog/infoDialogSlice.ts @@ -13,7 +13,7 @@ import { PokemonSpeciesResponseData, } from 'types/api'; -type InfoDiaglogDetails = { +export type InfoDialogDetails = { id: number; name: string; genera: string; @@ -28,7 +28,7 @@ type InfoDiaglogDetails = { evolutionChain: EvolutionSpeciesProps[]; }; -const initialInfoDialogDetails: InfoDiaglogDetails = { +const initialInfoDialogDetails: InfoDialogDetails = { id: 0, name: '', genera: '', @@ -45,7 +45,7 @@ const initialInfoDialogDetails: InfoDiaglogDetails = { export type InfoDialogStateProps = { isOpen: boolean; - InfoDialogDetails: InfoDiaglogDetails; + InfoDialogDetails: InfoDialogDetails; }; export const initialState: InfoDialogStateProps = { @@ -90,7 +90,7 @@ export const constructPokemonInfoFromResponses = ( fetchedPokemon: PokemonResponseData, fetchedPokemonSpecies: PokemonSpeciesResponseData, evolutionChain: EvolutionSpeciesProps[], -): InfoDiaglogDetails => { +): InfoDialogDetails => { return { id: fetchedPokemon.id, name: fetchedPokemon.name,