From 582a0f44db64aa881cc5d65eec80a2c3edebbd39 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sun, 28 Mar 2021 13:56:32 +0200 Subject: [PATCH] refactor home container --- src/containers/Home/index.tsx | 25 +++++++++++++++++++++++++ src/containers/HomeController.tsx | 6 ------ src/pages/HomePage.tsx | 22 ---------------------- src/router/AppRouter.tsx | 4 ++-- 4 files changed, 27 insertions(+), 30 deletions(-) create mode 100644 src/containers/Home/index.tsx delete mode 100644 src/containers/HomeController.tsx delete mode 100644 src/pages/HomePage.tsx diff --git a/src/containers/Home/index.tsx b/src/containers/Home/index.tsx new file mode 100644 index 0000000..6e9b01e --- /dev/null +++ b/src/containers/Home/index.tsx @@ -0,0 +1,25 @@ +import React from "react"; +import { RandomButton } from "../../components/RandomButton"; +import HeroImage from "../../images/chef.svg"; + +export const Home = () => { + const buttonUrl = "/random"; + return ( +
+
+
+

Chef's Online Cookbook

+ {}} + /> +
+ + hero_image + +
+
+ ); +}; diff --git a/src/containers/HomeController.tsx b/src/containers/HomeController.tsx deleted file mode 100644 index 320cc63..0000000 --- a/src/containers/HomeController.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import React from "react"; -import { HomePage } from "../pages/HomePage"; - -export const HomeController = ({ buttonUrl }) => { - return ; -}; diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx deleted file mode 100644 index f567e3d..0000000 --- a/src/pages/HomePage.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react"; -import { RandomButton } from "../components/RandomButton"; - -export const HomePage = ({ buttonUrl }) => { - return ( -
-
-
-

Chef's Online Cookbook

- {}}/> -
-
- hero_image -
-
-
- ); -}; diff --git a/src/router/AppRouter.tsx b/src/router/AppRouter.tsx index 5b3cc46..282600d 100644 --- a/src/router/AppRouter.tsx +++ b/src/router/AppRouter.tsx @@ -1,6 +1,6 @@ import { Switch, Route, Redirect } from "react-router-dom"; import { SearchController } from "../containers/SearchController"; -import { HomeController } from "../containers/HomeController"; +import { Home } from "../containers/Home"; import { MealController } from "../containers/MealController"; import { CategoryController } from "../containers/CategoryController"; import { CategoryListController } from "../containers/CategoryListController"; @@ -21,7 +21,7 @@ const AppRouter = ({ }) => ( - +