Skip to content

Instantly share code, notes, and snippets.

View iamkevingreen's full-sized avatar
💭
🍝 🍝 🍝 🍝 🍝 🍝

Kevin Green iamkevingreen

💭
🍝 🍝 🍝 🍝 🍝 🍝
View GitHub Profile
import React, {useState, useEffect, useRef} from 'react'
import classNames from 'classnames'
import {useIntersection} from 'use-intersection'
const Video = ({
video,
poster,
posterWidth = 1920,
posterFitMode = 'preserve',
const sanityClient = require('@sanity/client');
const crypto = require('crypto');
const {
SANITY_API_TOKEN,
SANITY_PROJECT_ID,
SANITY_DATASET,
SHOPIFY_SECRET
} = process.env;
import React from 'react'
import { Router } from '@reach/router'
import { pageQuery, productQuery, articleQuery } from '../api/preview.js'
import Page from '../templates/page.js'
import Product from '../templates/product.js'
import Editorial from '../templates/editorial.js'
const sanityClient = require('@sanity/client')
import React from 'react';
import ReactDOM from 'react-dom';
import { Strider, Step } from 'react-strider';
import cx from 'classnames'
class App extends React.Component {
render () {
return (
<div>
<h1>React Strider</h1>
const marked = require('marked')
module.exports = (data) => {
return `
<section className='z1 rel'>
<div className='rel f aic jcc'>
<div className='container rel fill-h'>
<div className='outer container--c container--a'>
${marked(data.fields.textContent)}
</div>
const TextModule = require('./TextModule.js')
const FullImageModule = require('./FullImageModule.js')
module.exports = (module, type) => {
console.log(type)
switch (type) {
case 'modulePassportText':
return TextModule(module)
case 'modulePassportFullImage':
return FullImageModule(module)
const RenderModules = require('../components/RenderModules')
const MapModules = (modules) => {
return modules.map((module) => {
const type = module.sys.contentType ? module.sys.contentType.sys.id : false
return RenderModules(module, type)
})
}
module.exports = (data) => {
const contentfulAPI = require('./contentful')
const shopifyAPI = require('./shopify')
const config = require('../config')
const buildBlogPost = require('../layouts/article')
module.exports = (data) => {
const articleId = data.fields.articleId['en-US']
contentfulAPI.getEntries({
const Shopify = require('shopify-api-node')
const config = require('../config')
module.exports = new Shopify({
shopName: config.shopify.shopName,
apiKey: config.shopify.apiKey,
password: config.shopify.password
})
module.exports = {
contentful: {
token: '',
space: ''
},
shopify: {
shopName: '',
apiKey: '',
password: '',
blogId: '',