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 React from 'react';
import Link from 'next/link'; import Header from '../components/header';
export default function About() { export default function About() {
return ( return (
<div> <div>
<Header />
<p>This is the about page</p> <p>This is the about page</p>
</div> </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 React from 'react';
import Link from 'next/link'; import Home from './home';
const Index = () => ( const Index = () => (
<div> <div>
<Link href="/about"> <Home />
<a title="About Page">About Page</a>
</Link>
<p>Hello Next.js</p>
</div> </div>
); );

Loading…
Cancel
Save