refactor layout

This commit is contained in:
Ruidy 2021-03-28 13:48:09 +02:00
parent 8fb5ca872c
commit 41758bbdf2
2 changed files with 13 additions and 10 deletions

View file

@ -1,9 +1,10 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { Footer } from "../components/Footer";
import { Navbar } from "../components/Navbar"; import { Navbar } from "../components/Navbar";
import { SearchBar } from "../components/SearchBar"; import { SearchBar } from "../components/SearchBar";
import { Footer } from "../components/Footer";
import { SideNav } from "../components/SideNav"; import { SideNav } from "../components/SideNav";
// TODO FC...
const MainLayout = ({ const MainLayout = ({
buttonUrl, buttonUrl,
getRandomMeal, getRandomMeal,
@ -62,7 +63,7 @@ const MainLayout = ({
closeNavClick={closeNavClick} closeNavClick={closeNavClick}
links={links} links={links}
buttonUrl={buttonUrl} buttonUrl={buttonUrl}
handleClick={()=>{}} handleClick={() => {}}
/> />
</header> </header>
{children} {children}

View file

@ -1,12 +1,14 @@
import React from "react"; import { FC } from "react";
const PageLayout = ({ title, children }) => { type Props = {
return ( title: string;
<div className="container">
<h1 className="logo">{title}</h1>
{children}
</div>
);
}; };
const PageLayout: FC<Props> = ({ title, children }) => (
<div className="container">
<h1 className="logo">{title}</h1>
{children}
</div>
);
export default PageLayout; export default PageLayout;