Upgraded deps, fix build errors

This commit is contained in:
Corbin Crutchley
2019-06-23 19:58:41 -07:00
parent f69eaa08cc
commit ab4f707b3d
8 changed files with 958 additions and 482 deletions

View File

@@ -72,7 +72,7 @@ exports.createPages = ({ graphql, actions }) => {
}) })
}) })
authors.forEach((author, index, arr) => { authors.forEach((author) => {
createPage({ createPage({
path: `authors/${author.node.id}`, path: `authors/${author.node.id}`,
component: blogAuthor, component: blogAuthor,

1374
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,27 +11,28 @@
"classnames": "^2.2.6", "classnames": "^2.2.6",
"css-loader": "^3.0.0", "css-loader": "^3.0.0",
"disqus-react": "^1.0.5", "disqus-react": "^1.0.5",
"gatsby": "^2.8.2", "gatsby": "^2.10.0",
"gatsby-image": "^2.1.2", "gatsby-image": "^2.2.1",
"gatsby-plugin-feed": "^2.2.2", "gatsby-plugin-feed": "^2.3.0",
"gatsby-plugin-google-analytics": "^2.0.20", "gatsby-plugin-google-analytics": "^2.1.0",
"gatsby-plugin-manifest": "^2.1.1", "gatsby-plugin-lunr": "^1.5.1",
"gatsby-plugin-offline": "^2.1.1", "gatsby-plugin-manifest": "^2.2.0",
"gatsby-plugin-offline": "^2.2.0",
"gatsby-plugin-prefetch-google-fonts": "^1.4.2", "gatsby-plugin-prefetch-google-fonts": "^1.4.2",
"gatsby-plugin-react-helmet": "^3.0.12", "gatsby-plugin-react-helmet": "^3.1.0",
"gatsby-plugin-react-svg": "^2.1.1", "gatsby-plugin-react-svg": "^2.1.1",
"gatsby-plugin-sass": "^2.1.0", "gatsby-plugin-sass": "^2.1.0",
"gatsby-plugin-sharp": "^2.1.3", "gatsby-plugin-sharp": "^2.2.1",
"gatsby-plugin-transition-link": "^1.12.4", "gatsby-plugin-transition-link": "^1.12.4",
"gatsby-remark-copy-linked-files": "^2.0.13", "gatsby-remark-copy-linked-files": "^2.1.0",
"gatsby-remark-images": "^3.0.14", "gatsby-remark-images": "^3.1.0",
"gatsby-remark-prismjs": "^3.2.9", "gatsby-remark-prismjs": "^3.3.0",
"gatsby-remark-responsive-iframe": "^2.1.1", "gatsby-remark-responsive-iframe": "^2.2.0",
"gatsby-remark-smartypants": "^2.0.9", "gatsby-remark-smartypants": "^2.1.0",
"gatsby-source-filesystem": "^2.0.38", "gatsby-source-filesystem": "^2.1.0",
"gatsby-transformer-json": "^2.1.11", "gatsby-transformer-json": "^2.2.0",
"gatsby-transformer-remark": "^2.3.12", "gatsby-transformer-remark": "^2.5.0",
"gatsby-transformer-sharp": "^2.1.21", "gatsby-transformer-sharp": "^2.2.0",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"prismjs": "^1.16.0", "prismjs": "^1.16.0",
"react": "^16.8.6", "react": "^16.8.6",
@@ -50,12 +51,12 @@
"@testing-library/react": "^8.0.1", "@testing-library/react": "^8.0.1",
"babel-jest": "^24.8.0", "babel-jest": "^24.8.0",
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"babel-preset-gatsby": "^0.1.11", "babel-preset-gatsby": "^0.2.0",
"identity-obj-proxy": "^3.0.0", "identity-obj-proxy": "^3.0.0",
"jest": "^24.8.0", "jest": "^24.8.0",
"jest-dom": "^3.5.0", "jest-dom": "^3.5.0",
"jest-watch-typeahead": "^0.3.1", "jest-watch-typeahead": "^0.3.1",
"prettier": "^1.17.1" "prettier": "^1.18.2"
}, },
"homepage": "https://unicorn-utterances.com", "homepage": "https://unicorn-utterances.com",
"keywords": [ "keywords": [

View File

@@ -24,16 +24,12 @@ export const Layout = ({ location, title, children }) => {
</header> </header>
<main className={!isBlogPost ? "listViewContent" : "postViewContent"}>{children}</main> <main className={!isBlogPost ? "listViewContent" : "postViewContent"}>{children}</main>
<footer> <footer>
© {new Date().getFullYear()}, Built with {''}
{` `}
<a href="https://www.gatsbyjs.org">Gatsby</a>
</footer> </footer>
</div> </div>
) )
} }
export default Layout
export const authorFragmentQuery = graphql` export const authorFragmentQuery = graphql`
fragment AuthorInfo on AuthorsJson { fragment AuthorInfo on AuthorsJson {
name name

View File

@@ -3,8 +3,7 @@ import Image from "gatsby-image"
import styles from "./post-metadata.module.scss" import styles from "./post-metadata.module.scss"
export const PostMetadata = ({ post }) => { export const PostMetadata = ({ post }) => {
const { frontmatter } = post const { author } = post.frontmatter
const { author } = frontmatter
return ( return (
<div className={styles.container}> <div className={styles.container}>
@@ -12,7 +11,7 @@ export const PostMetadata = ({ post }) => {
<div className={styles.textDiv}> <div className={styles.textDiv}>
<h2 className={styles.authorName}>{author.name}</h2> <h2 className={styles.authorName}>{author.name}</h2>
<div className={styles.belowName}> <div className={styles.belowName}>
<p className={styles.date}>{frontmatter.date}</p> <p className={styles.date}>{post.frontmatter.date}</p>
<p className={styles.wordCount}>{post.wordCount.words} words</p> <p className={styles.wordCount}>{post.wordCount.words} words</p>
</div> </div>
</div> </div>

View File

@@ -2,8 +2,8 @@ import React from "react"
import styles from "./post-title-header.module.scss" import styles from "./post-title-header.module.scss"
export const PostTitleHeader = ({ post }) => { export const PostTitleHeader = ({ post }) => {
const { frontmatter: { title, subtitle, tags } } = post const { title, subtitle, tags } = post.frontmatter
return ( return (
<div className={styles.container}> <div className={styles.container}>
<div className={styles.tags}>{tags.map(tag => <p key={tag}>{tag}</p>)}</div> <div className={styles.tags}>{tags.map(tag => <p key={tag}>{tag}</p>)}</div>

View File

@@ -1,6 +1,6 @@
import React from "react" import React from "react"
import { graphql } from "gatsby" import { graphql } from "gatsby"
import Layout from "../components/layout/layout" import {Layout} from "../components/layout/layout"
import { SEO } from "../components/seo" import { SEO } from "../components/seo"
import { PostList } from "../components/post-card-list" import { PostList } from "../components/post-card-list"
import { PicTitleHeader } from "../components/pic-title-header" import { PicTitleHeader } from "../components/pic-title-header"

View File

@@ -5,6 +5,10 @@
import { useEffect, useState } from "react" import { useEffect, useState } from "react"
function getSize() { function getSize() {
if (!global.window || !window) {
return {}
}
return { return {
innerHeight: window.innerHeight, innerHeight: window.innerHeight,
innerWidth: window.innerWidth, innerWidth: window.innerWidth,
@@ -29,6 +33,10 @@ export const useWindowSize = debounceMs => {
} }
useEffect(() => { useEffect(() => {
if (windowSize.innerHeight === undefined) {
setWindowSize(getSize())
}
window.addEventListener("resize", handleResize) window.addEventListener("resize", handleResize)
return () => { return () => {
window.removeEventListener("resize", handleResize) window.removeEventListener("resize", handleResize)