Add basic components

pull/1331/head
Kamran Ahmed 5 years ago
parent 8c77a26627
commit b351edfa20
  1. 15
      components/header/index.js
  2. 3
      pages/about.js
  3. 10
      pages/home.js
  4. 7
      pages/index.js

@ -0,0 +1,15 @@
import Link from 'next/link';
const Header = () => (
<div>
<Link href="/">
<a title="Homepage">Home</a>
</Link>
&nbsp; |&nbsp;
<Link href="/about">
<a title="About Page">About Page</a>
</Link>
</div>
);
export default Header;

@ -1,9 +1,10 @@
import React from 'react';
import Link from 'next/link';
import Header from '../components/header';
export default function About() {
return (
<div>
<Header />
<p>This is the about page</p>
</div>
);

@ -0,0 +1,10 @@
import Header from '../components/header';
export const Home = (props) => (
<div>
<Header />
<p>Hello Next.js</p>
</div>
);
export default Home;

@ -1,12 +1,9 @@
import React from 'react';
import Link from 'next/link';
import Home from './home';
const Index = () => (
<div>
<Link href="/about">
<a title="About Page">About Page</a>
</Link>
<p>Hello Next.js</p>
<Home />
</div>
);

Loading…
Cancel
Save