Skip to content

Commit

Permalink
[Add] Global Layout
Browse files Browse the repository at this point in the history
  • Loading branch information
VicDario committed Jan 23, 2022
1 parent 0fafc97 commit 333c8c0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
15 changes: 15 additions & 0 deletions components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { NextPage } from "next";

import Navbar from "components/Navbar/Navbar";

const Layout: React.FC = ({ children }) => {
return (
<div>
<Navbar />
{children}
<footer>This is the footer</footer>
</div>
)
}

export default Layout;
7 changes: 6 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { AppProps } from 'next/app'
import Layout from 'components/Layout/Layout';

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
return(
<Layout>
<Component {...pageProps} />
</Layout>
)
}

// Only uncomment this method if you have blocking data requirements for
Expand Down
1 change: 0 additions & 1 deletion pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Navbar from '../components/Navbar/Navbar';
const About: NextPage = () => {
return (
<div>
<Navbar />
<h1>About Platzi-avo</h1>
</div>
)
Expand Down
1 change: 0 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const Home: NextPage = () => {
}, []);
return (
<div>
<Navbar />
<h1>Home Platzi-avo</h1>
{productList.map((product, index) => {
return (
Expand Down

0 comments on commit 333c8c0

Please sign in to comment.