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, { useRef, useLayoutEffect } from "react"; | |
import { StyleSheetManager } from "styled-components"; | |
import PreviewContext from "./PreviewContext"; | |
const WithPreviewContext = ({ children }) => | |
<PreviewContext.Provider value={true}> | |
<main> | |
{children} | |
</main> | |
</PreviewContext.Provider>; |
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 addToMailchimp from 'gatsby-plugin-mailchimp'; | |
import React, { useState } from 'react'; | |
import * as styles from './EmailListForm.module.scss'; | |
const EmailListForm: React.FunctionComponent<{}> = () => { | |
const [email, setEmail] = useState(''); | |
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => { | |
e.preventDefault(); |
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 * as React from "react" | |
import { Frame, FrameProps } from "framer" | |
import { observer } from "mobx-react" | |
import { store } from "./store" | |
const DecoratedCounter = observer(props => { | |
return <Frame onTap={store.increment}>{store.count}</Frame> | |
}) |
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 * as React from "react" | |
import { Frame, FrameProps } from "framer" | |
type Props = Partial<FrameProps> & { | |
onValueChange: (value: number) => void | |
} | |
export function EventPropExample(props: Props) { | |
const { onValueChange, ...rest } = props |
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
/** extracted page creation functionality into smaller functions **/ | |
const path = require('path'); | |
function createBlogPostsPages(result, createPage) { | |
const blogPostTemplate = path.join(__dirname, `../src/templates/blog-post.js`); | |
const blogPosts = result.data.blogs.edges; | |
blogPosts.forEach((post, index) => { | |
const previous = index === blogPosts.length - 1 ? null : blogPosts[index + 1].node; |
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
<script src="https://cdn.jsdelivr.net/npm/[email protected]/a11y-dialog.min.js"></script> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=ADD-ID-HERE"></script> | |
<script> | |
'use strict'; | |
var cookieName = 'company-gdpr'; | |
var redirect = '{{ gdpr_cta_decline_url }}'; // Redirect for decline | |
var expiration = {{ gdpr_expiry_time }}; // Expiration time in days | |
var animDuration = 200; // Animation duration in milliseconds | |
var animDelay = 1000; // Animation duration in milliseconds | |
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; |
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
// Framer X Utils.modulate equivalent | |
function modulate(value, rangeA, rangeB, limit = false) { | |
const [fromLow, fromHigh] = rangeA; | |
const [toLow, toHigh] = rangeB; | |
const result = toLow + ((value - fromLow) / (fromHigh - fromLow)) * (toHigh - toLow); | |
if (limit === true) { | |
if (toLow < toHigh) { | |
if (result < toLow) { | |
return toLow; |
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 (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
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
const algoliasearch = require('algoliasearch'); | |
const request = require('request'); | |
const ndjson = require('ndjson'); | |
const {bindNodeCallback} = require('rxjs'); | |
const {streamToRx} = require('rxjs-stream'); | |
const {bufferCount, map, mergeMap, toArray, tap} = require('rxjs/operators'); | |
// Algolia configuration | |
const algoliaApp = 'your_app_id'; |
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
# Insomnia Configuration | |
## Run the test query | |
{ | |
shop { | |
id | |
name | |
} | |
} | |
# Query Structure Examples |