mirror of
https://github.com/rjNemo/meal_planner
synced 2026-06-12 13:26:45 +00:00
refactor home container
This commit is contained in:
parent
41758bbdf2
commit
582a0f44db
4 changed files with 27 additions and 30 deletions
25
src/containers/Home/index.tsx
Normal file
25
src/containers/Home/index.tsx
Normal file
|
|
@ -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 (
|
||||
<section className="container ">
|
||||
<div className="row">
|
||||
<div className="col s12 m6">
|
||||
<h1 className="logo">Chef's Online Cookbook</h1>
|
||||
<RandomButton
|
||||
url={buttonUrl}
|
||||
size="large"
|
||||
color="orange darken-2"
|
||||
handleClick={() => {}}
|
||||
/>
|
||||
</div>
|
||||
<picture className="col s12 m6">
|
||||
<img src={HeroImage} alt="hero_image" width="100%" />
|
||||
</picture>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
import React from "react";
|
||||
import { HomePage } from "../pages/HomePage";
|
||||
|
||||
export const HomeController = ({ buttonUrl }) => {
|
||||
return <HomePage buttonUrl={buttonUrl} />;
|
||||
};
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
import React from "react";
|
||||
import { RandomButton } from "../components/RandomButton";
|
||||
|
||||
export const HomePage = ({ buttonUrl }) => {
|
||||
return (
|
||||
<div className="container ">
|
||||
<div className="row">
|
||||
<div className="col s12 m6">
|
||||
<h1 className="logo">Chef's Online Cookbook</h1>
|
||||
<RandomButton url={buttonUrl} size="large" color="orange darken-2" handleClick={()=>{}}/>
|
||||
</div>
|
||||
<div className="col s12 m6">
|
||||
<img
|
||||
src={require("../images/chef.svg")}
|
||||
alt="hero_image"
|
||||
width="100%"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
@ -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 = ({
|
|||
}) => (
|
||||
<Switch>
|
||||
<Route exact path="/">
|
||||
<HomeController buttonUrl={buttonUrl} />
|
||||
<Home />
|
||||
</Route>
|
||||
|
||||
<PrivateRoute exact path="/profile" component={ProfileController} />
|
||||
|
|
|
|||
Loading…
Reference in a new issue