Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all packages to latest, update outdated Gatsby APIs, convert project to TypeScript #102

Draft
wants to merge 6 commits into
base: development
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
@@ -7,9 +7,10 @@ module.exports = {
title: `Gatsby Starter SaaS Marketing`,
description: `A simple one page marketing starter for saas companies.`,
author: `Keegan Burkett`,
image: `/gatsby-icon.png`,
url: `www.gatsbyjs.com`,
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-styled-components`,
{
resolve: `gatsby-plugin-google-analytics`,
29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -5,28 +5,27 @@
"version": "0.1.0",
"author": "Keegan Burkett <[email protected]>",
"dependencies": {
"gatsby": "^4.20.0",
"gatsby-image": "^3.11.0",
"gatsby-plugin-google-analytics": "^4.20.0",
"gatsby-plugin-manifest": "^4.20.0",
"gatsby-plugin-offline": "^5.20.0",
"gatsby-plugin-react-helmet": "^5.20.0",
"gatsby-plugin-sharp": "^4.20.0",
"gatsby-plugin-styled-components": "^5.20.0",
"axios": "1.3.3",
"gatsby": "^5.7.0",
"gatsby-plugin-google-analytics": "^5.7.0",
"gatsby-plugin-image": "^3.7.0",
"gatsby-plugin-manifest": "^5.7.0",
"gatsby-plugin-offline": "^6.7.0",
"gatsby-plugin-sharp": "^5.7.0",
"gatsby-plugin-styled-components": "^6.7.0",
"gatsby-plugin-web-font-loader": "^1.0.4",
"gatsby-source-filesystem": "^4.20.0",
"gatsby-transformer-sharp": "^4.20.0",
"prop-types": "^15.8.1",
"gatsby-source-filesystem": "^5.7.0",
"gatsby-transformer-sharp": "^5.7.0",
"react": "^18.2.0",
"react-anchor-link-smooth-scroll": "^1.0.12",
"react-dom": "^18.2.0",
"react-feather": "^2.0.8",
"react-helmet": "^6.1.0",
"react-feather": "^2.0.10",
"react-scrollspy": "^3.4.3",
"styled-components": "^5.3.5"
"styled-components": "^5.3.6"
},
"devDependencies": {
"prettier": "^2.7.1"
"@types/styled-components": "^5.1.26",
"prettier": "^2.8.4"
},
"resolutions": {
"axios": "0.21.1"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import { useStaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import { GatsbyImage } from "gatsby-plugin-image"

/*
* This component is built using `gatsby-image` to automatically serve optimized
@@ -18,15 +18,13 @@ const Image = () => {
query {
placeholderImage: file(relativePath: { eq: "gatsby-astronaut.png" }) {
childImageSharp {
fluid(maxWidth: 300) {
...GatsbyImageSharpFluid
}
gatsbyImageData(layout: CONSTRAINED)
}
}
}
`)

return <Img fluid={data.placeholderImage.childImageSharp.fluid} />
return <GatsbyImage alt="Sample Image" image={data.placeholderImage.childImageSharp.gatsbyImageData} />
}

export default Image
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React from "react"
import PropTypes from "prop-types"
import { ThemeProvider } from "styled-components"

import theme from "../../../styles/theme"
import GlobalStyles from "../../../styles/GlobalStyles"
import "../../../static/fonts/fonts.css"

const Layout = ({ children }) => (
interface LayoutProps {
children: React.ReactNode,
}

const Layout = ({ children }: LayoutProps) => (
<ThemeProvider theme={theme}>
<>
<GlobalStyles />
@@ -15,8 +18,4 @@ const Layout = ({ children }) => (
</ThemeProvider>
)

Layout.propTypes = {
children: PropTypes.node.isRequired,
}

export default Layout
81 changes: 0 additions & 81 deletions src/components/common/layout/seo.js

This file was deleted.

53 changes: 53 additions & 0 deletions src/components/common/layout/seo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from "react"
import { useStaticQuery, graphql } from "gatsby"

interface SEOProps {
description?: string,
lang?: string,
title?: string,
children?: React.ReactNode,
}

const SEO = ({ description, lang = 'en', title, children }: SEOProps) => {
const { site } = useStaticQuery(
graphql`
query {
site {
siteMetadata {
title
description
author
image
url
}
}
}
`
)

const metaDescription = description || site.siteMetadata.description
const metaTitle = title ? `${title} | ${site.siteMetadata.title}` : site.siteMetadata.title


return (
<>
<html lang={lang} />
<title>{metaTitle}</title>
<meta name="description" content={metaDescription} />
<meta name="image" content={site.image} />
<meta name="og:title" content={metaTitle} />
<meta name="og:description" content={metaDescription} />
<meta name="og:type" content={"website"} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content={metaTitle} />
<meta name="twitter:url" content={site.url} />
<meta name="twitter:description" content={metaDescription} />
<meta name="twitter:image" content={site.image} />
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content={site.author} />
{children}
</>
)
}

export default SEO
112 changes: 0 additions & 112 deletions src/components/common/navigation/navigation.js

This file was deleted.

Loading