Skip to content

Commit 5159f0c

Browse files
committed
lesson-5
1 parent 75efac5 commit 5159f0c

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

comps/Layout.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Footer from "./Footer"
2+
import Navbar from "./Navbar"
3+
4+
const Layout = ({ children }) => {
5+
return (
6+
<div className="content">
7+
<Navbar />
8+
{ children }
9+
<Footer />
10+
</div>
11+
);
12+
}
13+
14+
export default Layout;

pages/_app.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
import Layout from '../comps/Layout'
12
import '../styles/globals.css'
23

34
function MyApp({ Component, pageProps }) {
4-
return <Component {...pageProps} />
5+
return (
6+
<Layout>
7+
<Component {...pageProps} />
8+
</Layout>
9+
)
510
}
611

712
export default MyApp

pages/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import styles from '../styles/Home.module.css'
77
export default function Home() {
88
return (
99
<div>
10-
<Navbar />
1110
<h1>Homepage</h1>
1211
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus animi impedit suscipit architecto, odio inventore nostrum non neque dicta. Quam magni accusantium culpa distinctio tempore iure accusamus, dolorem nobis odit.</p>
1312
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Minus animi impedit suscipit architecto, odio inventore nostrum non neque dicta. Quam magni accusantium culpa distinctio tempore iure accusamus, dolorem nobis odit.</p>
1413
<Link href="/ninjas/">
1514
<a>See Ninja Listing</a>
1615
</Link>
17-
<Footer />
1816
</div>
1917
)
2018
}

pages/ninjas/test.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)