This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { graphql, useStaticQuery } from "gatsby" | |
type Props = { | |
site: { | |
siteMetadata: { | |
title: string | |
tagline: string | |
description: string | |
language: string | |
siteUrl: string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useLayoutEffect } from "react" | |
export const useBodyScrolllock = toggle => { | |
useLayoutEffect(() => { | |
let originalStyle | |
let lockScroll = !toggle ? false : true | |
if (lockScroll) { | |
originalStyle = window.getComputedStyle(document.body).overflow | |
document.body.style.overflow = "hidden" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
siteMetadata: { | |
title: `Gatsby Default Starter`, | |
tagline: `This is what we do!`, | |
description: `Lorem ipsum, dolor sit amet consectetur adipisicing elit. Ad amet ex et sed in. Nobis debitis earum ullam expedita harum?`, | |
siteUrl: `https://www.livewebsiteURL.com`, | |
author: `@thinkmechanic`, | |
language: `en`, | |
pages: [ | |
{ label: "home", path: "/" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SEO component that queries for data with | |
* Gatsby's useStaticQuery React hook | |
* | |
* See: https://www.gatsbyjs.org/docs/use-static-query/ | |
*/ | |
import React from "react" | |
import Helmet from "react-helmet" | |
import useSiteMetadata from "../hooks/use-site-metadata" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import { Box, Button, Code } from '@chakra-ui/core'; | |
const json = ({ data }) => { | |
const [open, setOpen] = useState(false); | |
React.useEffect(() => { | |
setOpen(data ? true : false); | |
}, [data]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function seed (length, schema) { | |
return new Array(length) //create a new array with length(num) of 'undefined' values | |
.fill(1) // convert 'undefined' values to the number 1 | |
.map((_, i) => ({schema})) // map over the array length(num) of times and output an item based on schema | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { chakra, ThemingProps, useStyleConfig } from '@chakra-ui/react' | |
import NextImage, { ImageProps as NextImageProps } from 'next/image' | |
import { ReactElement } from 'react' | |
/** | |
* ? Because NextJs typing is preventing auto-suggest for layout, width and height | |
* ? we declare the styles differently in this component and will manage the switch | |
* ? to NextJs typings when calling NextJs Image component | |
*/ | |
type LayoutValue = 'fixed' | 'intrinsic' | 'responsive' | undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
webpack: function(config) { | |
config.module.rules.push({ | |
test: /\.md$/, | |
use: 'raw-loader', | |
}) | |
return config | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Octokit } from '@octokit/rest' | |
import { nanoid } from 'nanoid' | |
export interface GitHubCMSOptions { | |
owner: string; | |
repo: string; | |
token: string; | |
} | |
export interface Comment { |