From 9e665f6673a3d6362672b20bd0141167648d13b2 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Thu, 17 Sep 2020 22:02:28 +0200 Subject: [PATCH] Create initial layout --- gatsby-config.js | 13 +++++- src/components/footer.js | 12 +++++ src/components/header.js | 53 ++++++++++----------- src/components/layout.js | 44 +++++++++--------- src/components/seo.js | 88 ----------------------------------- src/components/social.js | 50 ++++++++++++++++++++ src/pages/404.js | 4 +- src/pages/index.js | 9 +--- src/styles/footer.module.scss | 10 ++++ src/styles/header.module.scss | 24 ++++++++++ src/styles/layout.module.scss | 11 +++++ src/styles/social.module.scss | 22 +++++++++ src/styles/variables.scss | 1 + 13 files changed, 193 insertions(+), 148 deletions(-) create mode 100644 src/components/footer.js delete mode 100644 src/components/seo.js create mode 100644 src/components/social.js create mode 100644 src/styles/footer.module.scss create mode 100644 src/styles/header.module.scss create mode 100644 src/styles/layout.module.scss create mode 100644 src/styles/social.module.scss diff --git a/gatsby-config.js b/gatsby-config.js index 85ce61a..f79c271 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,8 +1,17 @@ module.exports = { siteMetadata: { - title: `Gatsby Default Starter`, + title: `Matúš Námešný`, description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`, - author: `@gatsbyjs`, + author: `Matúš Námešný`, + email: "matus@namesny.com", + social: { + names: ["github", "codepen", "linkedin"], + links: [ + "https://github.com/LordMathis", + "https://codepen.io/LordMathis/", + "https://www.linkedin.com/in/mat%C3%BA%C5%A1-n%C3%A1me%C5%A1n%C3%BD-3903b6128/", + ] + }, }, plugins: [ `gatsby-plugin-react-helmet`, diff --git a/src/components/footer.js b/src/components/footer.js new file mode 100644 index 0000000..8a26c47 --- /dev/null +++ b/src/components/footer.js @@ -0,0 +1,12 @@ +import React from "react" +import styles from '../styles/footer.module.scss' + +const Footer = ({authorName}) => ( + +) + +export default Footer \ No newline at end of file diff --git a/src/components/header.js b/src/components/header.js index 8990b7e..2ce91a3 100644 --- a/src/components/header.js +++ b/src/components/header.js @@ -1,42 +1,43 @@ import { Link } from "gatsby" +import Social from "./social" import PropTypes from "prop-types" import React from "react" +import styles from "../styles/header.module.scss" -const Header = ({ siteTitle }) => ( -
-
-

- - {siteTitle} - -

-
+const Header = ({ siteTitle, socialNames, socialLinks, email }) => ( +
+ +
) Header.propTypes = { siteTitle: PropTypes.string, + socialNames: PropTypes.arrayOf(PropTypes.string), + socialLinks: PropTypes.arrayOf(PropTypes.string), } Header.defaultProps = { siteTitle: ``, + socialNames: [], + socialLinks: [], + email: ``, } export default Header diff --git a/src/components/layout.js b/src/components/layout.js index 61e1707..7060f82 100644 --- a/src/components/layout.js +++ b/src/components/layout.js @@ -1,22 +1,24 @@ -/** - * Layout component that queries for data - * with Gatsby's useStaticQuery component - * - * See: https://www.gatsbyjs.org/docs/use-static-query/ - */ - import React from "react" import PropTypes from "prop-types" import { useStaticQuery, graphql } from "gatsby" import Header from "./header" +import Footer from "./footer" +import { Helmet } from "react-helmet" +import styles from "../styles/layout.module.scss" -const Layout = ({ children }) => { +const Layout = ({ children, title }) => { const data = useStaticQuery(graphql` query SiteTitleQuery { site { siteMetadata { title + author + email + social { + names + links + } } } } @@ -24,21 +26,21 @@ const Layout = ({ children }) => { return ( <> -
-
+ + + {title} + + +
+
{children}
-
- © {new Date().getFullYear()}, Built with - {` `} - Gatsby -
+