Implemented index.ts for small components
This commit is contained in:
parent
47558e17d3
commit
a29c471a0b
@ -1,8 +1,7 @@
|
||||
import React from 'react';
|
||||
import './App.css';
|
||||
import Header from 'components/Header';
|
||||
import Filters from './features/Pokedex/Filters/Filters';
|
||||
import { Pokedex } from './features/Pokedex/Pokedex';
|
||||
import Pokedex from './features/Pokedex';
|
||||
import { useGetPokemonListQuery } from './features/Pokedex/pokedexApi';
|
||||
import Loading from './components/Loading';
|
||||
|
||||
@ -18,7 +17,6 @@ function App() {
|
||||
return (
|
||||
<div className="App app_container">
|
||||
<Header />
|
||||
<Filters />
|
||||
<Pokedex />
|
||||
</div>
|
||||
);
|
||||
|
@ -1 +1 @@
|
||||
export * from './Filters';
|
||||
export { default } from './Filters';
|
||||
|
@ -1,8 +1,16 @@
|
||||
import React from 'react';
|
||||
import { Pokemon } from './Pokemon';
|
||||
import Pokemon from './Pokemon';
|
||||
import Filters from './Filters';
|
||||
|
||||
import charizard from 'assets/charizard.svg';
|
||||
|
||||
export function Pokedex() {
|
||||
return <Pokemon name={'Charizard'} number={'#006'} image={charizard} />;
|
||||
}
|
||||
const Pokedex = () => {
|
||||
return (
|
||||
<>
|
||||
<Filters />
|
||||
<Pokemon name={'Charizard'} number={'#006'} image={charizard} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Pokedex;
|
||||
|
@ -7,7 +7,7 @@ export interface PokemonProps {
|
||||
image: string;
|
||||
}
|
||||
|
||||
export function Pokemon({ name, number, image }: PokemonProps) {
|
||||
export default function Pokemon({ name, number, image }: PokemonProps) {
|
||||
return (
|
||||
<div className="thumbnail__container">
|
||||
<div className="card__header">
|
||||
|
@ -1 +1,2 @@
|
||||
export * from './Pokemon';
|
||||
export { default } from './Pokemon';
|
||||
|
1
src/features/Pokedex/index.ts
Normal file
1
src/features/Pokedex/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export { default } from './Pokedex';
|
@ -2,8 +2,6 @@ import { createSlice } from '@reduxjs/toolkit';
|
||||
import type { PayloadAction } from '@reduxjs/toolkit';
|
||||
import type { RootState } from 'app/store';
|
||||
|
||||
import { PokemonProps as Pokemon } from './Pokemon';
|
||||
|
||||
interface PokedexState {
|
||||
selectedRegion: string;
|
||||
selectedType: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user