From b351edfa20e64fbd798492027b4824209c460b9d Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 24 Aug 2019 18:44:29 +0400 Subject: [PATCH] Add basic components --- components/header/index.js | 15 +++++++++++++++ pages/about.js | 3 ++- pages/home.js | 10 ++++++++++ pages/index.js | 7 ++----- 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 components/header/index.js create mode 100644 pages/home.js diff --git a/components/header/index.js b/components/header/index.js new file mode 100644 index 000000000..ea47a8af9 --- /dev/null +++ b/components/header/index.js @@ -0,0 +1,15 @@ +import Link from 'next/link'; + +const Header = () => ( +
+ + Home + +   |  + + About Page + +
+); + +export default Header; \ No newline at end of file diff --git a/pages/about.js b/pages/about.js index f0e28e649..33eb5033e 100644 --- a/pages/about.js +++ b/pages/about.js @@ -1,9 +1,10 @@ import React from 'react'; -import Link from 'next/link'; +import Header from '../components/header'; export default function About() { return (
+

This is the about page

); diff --git a/pages/home.js b/pages/home.js new file mode 100644 index 000000000..aaaaf8bd8 --- /dev/null +++ b/pages/home.js @@ -0,0 +1,10 @@ +import Header from '../components/header'; + +export const Home = (props) => ( +
+
+

Hello Next.js

+
+); + +export default Home; \ No newline at end of file diff --git a/pages/index.js b/pages/index.js index eb1e997c1..04f76537f 100644 --- a/pages/index.js +++ b/pages/index.js @@ -1,12 +1,9 @@ import React from 'react'; -import Link from 'next/link'; +import Home from './home'; const Index = () => (
- - About Page - -

Hello Next.js

+
);