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
| type EventNames = | |
| | 'add_payment_info' | |
| | 'add_to_cart' | |
| | 'add_to_wishlist' | |
| | 'begin_checkout' | |
| | 'checkout_progress' | |
| | 'exception' | |
| | 'generate_lead' | |
| | 'login' | |
| | 'page_view' |
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
| export const event = ( | |
| action: Gtag.EventNames, | |
| { event_category, event_label, value }: Gtag.EventParams | |
| ) => { | |
| window.gtag('event', action, { | |
| event_category, | |
| event_label, | |
| value | |
| }); | |
| }; |
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
| var gtag: Gtag.Gtag | |
| (command: "config", targetId: string, config?: Gtag.ControlParams | Gtag.EventParams | Gtag.CustomParams | undefined) => void (+6 overloads) |
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
| export const pageview = (url: URL) => { | |
| window.gtag('config', GA_TRACKING_ID, { | |
| page_path: url | |
| }); | |
| }; |
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
| /// <reference types="gtag.js" /> | |
| declare module 'gtag.js'; |
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
| "include": ["**/*.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"], |
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
| yarn add -D @types/gtag.js |
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 ReactMarkdown from 'react-markdown/with-html'; | |
| import Image, { ImageLoaderProps, ImageProps } from 'next/image'; | |
| import ReactMarkdown from 'react-markdown/with-html'; | |
| // ... | |
| // option A (a safe bet) | |
| const renderers = { |
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 dynamic from 'next/dynamic'; | |
| import { | |
| AboutBySlug, | |
| AboutBySlugVariables | |
| } from '@lib/graphql/AboutBySlug/__generated__/AboutBySlug'; | |
| import ABOUT_BY_SLUG from '@lib/graphql/AboutBySlug'; | |
| import { useQuery } from '@apollo/client'; | |
| import cn from 'classnames'; | |
| import { AboutIdType } from '@_types/graphql-global-types'; | |
| import { useRouter } from 'next/router'; |
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 { useState } from 'react'; | |
| import Link from 'next/link'; | |
| import Query from '../components/query'; | |
| import CATEGORIES_QUERY from '../apollo/queries/category/categories'; | |
| // destructure categories as props for Header to pass that to getStaticProps in index | |
| const Header = ({ data: { categories } }) => { | |
| const [isExpanded, setIsExpanded] = useState(false); | |
| const expandedClasses = isExpanded ? ' flex' : ' hidden'; |