|
@@ -1,13 +1,19 @@
|
|
|
import React from 'react';
|
|
import React from 'react';
|
|
|
import {Route, Switch} from 'react-router-dom';
|
|
import {Route, Switch} from 'react-router-dom';
|
|
|
|
|
|
|
|
-import ShowPokemon from './pokemon/show';
|
|
|
|
|
|
|
+import PokemonShow from './pokemon/show';
|
|
|
|
|
+import PokemonIndex from './pokemon/index';
|
|
|
|
|
|
|
|
-function Pokemon() {
|
|
|
|
|
|
|
+import NotFound from './not_found';
|
|
|
|
|
+
|
|
|
|
|
+function Pokemon({match}) {
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<Switch>
|
|
<Switch>
|
|
|
- <Route path="/pokemon" component={ShowPokemon} />
|
|
|
|
|
|
|
+ <Route exact path={`${match.path}/:id`} component={PokemonShow} />
|
|
|
|
|
+ <Route exact path={`${match.path}`} component={PokemonIndex} />
|
|
|
|
|
+
|
|
|
|
|
+ <Route component={NotFound} />
|
|
|
</Switch>
|
|
</Switch>
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|