|
|
@@ -1,9 +1,12 @@
|
|
|
import React from 'react';
|
|
|
import { Route } from 'react-router';
|
|
|
import RecipesContainer from 'containers/Recipes';
|
|
|
+import CreateRecipe from 'containers/Recipes/Create';
|
|
|
+import ViewRecipe from 'containers/Recipes/View';
|
|
|
|
|
|
-const emptyRoute = (title: string) => () => {
|
|
|
- return (<h1>{title}</h1>);
|
|
|
+const emptyRoute = (title: string) => (props: any) => {
|
|
|
+ console.log(props);
|
|
|
+ return (<h1>{title} {props.match.params && props.match.params.id}</h1>);
|
|
|
};
|
|
|
|
|
|
const routes = [
|
|
|
@@ -12,7 +15,10 @@ const routes = [
|
|
|
component: RecipesContainer,
|
|
|
routes: [{
|
|
|
path: '/recipes/create',
|
|
|
- component: emptyRoute('create recipe'),
|
|
|
+ component: CreateRecipe,
|
|
|
+ }, {
|
|
|
+ path: '/recipes/view/:id',
|
|
|
+ component: ViewRecipe
|
|
|
},
|
|
|
{
|
|
|
path: '/recipes/edit',
|