This file contains 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, useEffect, useRef} from 'react' | |
import classNames from 'classnames' | |
import {useIntersection} from 'use-intersection' | |
const Video = ({ | |
video, | |
poster, | |
posterWidth = 1920, | |
posterFitMode = 'preserve', |
This file contains 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
const sanityClient = require('@sanity/client'); | |
const crypto = require('crypto'); | |
const { | |
SANITY_API_TOKEN, | |
SANITY_PROJECT_ID, | |
SANITY_DATASET, | |
SHOPIFY_SECRET | |
} = process.env; |
This file contains 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 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') |
This file contains 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 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> |
This file contains 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
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> |
This file contains 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
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) |
This file contains 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
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) => { |
This file contains 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
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({ |
This file contains 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
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 | |
}) |
This file contains 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 = { | |
contentful: { | |
token: '', | |
space: '' | |
}, | |
shopify: { | |
shopName: '', | |
apiKey: '', | |
password: '', | |
blogId: '', |
NewerOlder