+
+
- );
-};
+ )
+}
-export { App };
+export { App }
diff --git a/src/api/index.ts b/src/api/index.ts
index daff2ad..21c3454 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -1 +1 @@
-export { pokemonApi } from 'api/pokemon/pokemonApi';
+export { pokemonApi } from 'api/pokemon/pokemonApi'
diff --git a/src/api/pokemon/pokemonApi.ts b/src/api/pokemon/pokemonApi.ts
index 2f574fe..123bab5 100644
--- a/src/api/pokemon/pokemonApi.ts
+++ b/src/api/pokemon/pokemonApi.ts
@@ -1,13 +1,19 @@
-import { buildCreateApi, coreModule, reactHooksModule, createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
+import {
+ buildCreateApi,
+ coreModule,
+ reactHooksModule,
+ createApi,
+ fetchBaseQuery
+} from '@reduxjs/toolkit/query/react'
-import { isServer } from 'utils';
+import { isServer } from 'utils'
-type TPokemonData = {
- name: string;
- sprite: string;
+interface TPokemonData {
+ name: string
+ sprite: string
}
-let createApiFunction = createApi;
+let createApiFunction = createApi
/*
For data prefetching during SSR we need to use a modified createApi function.
@@ -17,20 +23,20 @@ if (isServer) {
createApiFunction = buildCreateApi(
coreModule(),
// eslint-disable-next-line camelcase
- reactHooksModule({ unstable__sideEffectsInRender: true }),
- );
+ reactHooksModule({ unstable__sideEffectsInRender: true })
+ )
}
export const pokemonApi = createApiFunction({
reducerPath: 'pokemonApi',
baseQuery: fetchBaseQuery({ baseUrl: 'https://pokeapi.co/api/v2/' }),
- endpoints: builder => ({
+ endpoints: (builder) => ({
getPokemonSpriteById: builder.query
({
- query: id => `pokemon/${id}`,
+ query: (id) => `pokemon/${id}`,
transformResponse: (response: any) => ({
name: response.species.name,
- sprite: response.sprites.other.dream_world.front_default,
- }),
- }),
- }),
-});
+ sprite: response.sprites.other.dream_world.front_default
+ })
+ })
+ })
+})
diff --git a/src/assets/images/app.gif b/src/assets/images/app.gif
index c31a6f8..d3da29b 100644
Binary files a/src/assets/images/app.gif and b/src/assets/images/app.gif differ
diff --git a/src/assets/index.html b/src/assets/index.html
index db5ec36..0ab90da 100644
--- a/src/assets/index.html
+++ b/src/assets/index.html
@@ -1,11 +1,12 @@
-
-
+ "
+ />
@@ -25,5 +27,4 @@
-