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 BRAND_NAME = 'Lorem Ipsum' | |
export function gtmProduct(product, variant) { | |
return { | |
name: product.title, | |
id: variant.sku, | |
price: parseFloat(variant.price), | |
variant: variant.title, | |
brand: BRAND_NAME, | |
category: 'All', |
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 { SwitchTransition, Transition } from 'react-transition-group' | |
import gsap from 'gsap' | |
function MyApp({ Component, pageProps, router }) { | |
return ( | |
<SwitchTransition> | |
<Transition | |
key={router.pathname} | |
timeout={500} | |
in={true} |
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 { createContext, useEffect, useState, useMemo, useContext } from 'react'; | |
import cookie from 'js-cookie'; | |
import firebase from 'lib/auth/firebase'; | |
import { useDocument } from '@nandorojo/swr-firestore'; | |
import type { UserModel } from 'types/UserModel'; | |
// Create a context that will hold the values that we are going to expose to our components. | |
// Don't worry about the `null` value. It's gonna be *instantly* overriden by the component below | |
type UserContextType = { | |
user: UserModel | null; |