From 0e9cd29df95cbd925e693240715c31d7186a47c6 Mon Sep 17 00:00:00 2001 From: Runar Skagestad Date: Mon, 30 Nov 2020 19:22:31 +0100 Subject: [PATCH] Gatsby tutorial part 1. --- src/components/header.js | 44 +++------------------------------------- src/pages/about.js | 10 +++++++++ src/pages/index.js | 29 ++++++++------------------ 3 files changed, 22 insertions(+), 61 deletions(-) create mode 100644 src/pages/about.js diff --git a/src/components/header.js b/src/components/header.js index 8990b7e..a7bb786 100644 --- a/src/components/header.js +++ b/src/components/header.js @@ -1,42 +1,4 @@ -import { Link } from "gatsby" -import PropTypes from "prop-types" import React from "react" - -const Header = ({ siteTitle }) => ( -
-
-

- - {siteTitle} - -

-
-
-) - -Header.propTypes = { - siteTitle: PropTypes.string, -} - -Header.defaultProps = { - siteTitle: ``, -} - -export default Header +export default function Header(props) { + return

{props.headerText}

+} \ No newline at end of file diff --git a/src/pages/about.js b/src/pages/about.js new file mode 100644 index 0000000..d1ee049 --- /dev/null +++ b/src/pages/about.js @@ -0,0 +1,10 @@ +import React from "react" +import Header from "../components/header"; +export default function About() { + return ( +
+
+

Bla bla. Bla.

+
+ ) +} \ No newline at end of file diff --git a/src/pages/index.js b/src/pages/index.js index 6f061ca..d2edc93 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,22 +1,11 @@ import React from "react" -import { Link } from "gatsby" -import Layout from "../components/layout" -import Image from "../components/image" -import SEO from "../components/seo" - -const IndexPage = () => ( - - -

Hi people

-

Welcome to your new Gatsby site.

-

Now go build something great.

-
- -
- Go to page 2
- Go to "Using TypeScript" -
-) - -export default IndexPage +export default function Home() { + return ( +
+

HallÄ!

+

What a world.

+ +
+ ); +} \ No newline at end of file