e2814943e9
* [feature] grids * Shows relative grids at different zoom levels * Update colors * Restores vec and intersect to monorepo, changes vec.round to vec.toFixed, adds vec.snap * Snapping in translate and transforms, fix shortcut * fix bugs in build * use grid size for nudge too * update scripts * Update grid.tsx * Update grid.tsx * Fixed! * Update grid.tsx * Fix package imports * Update Editor.tsx * Improve tsconfigs, imports * Fix tiny arrow bugs, snap starting points to grid * Update tsconfig.base.json * Update shape-styles.ts * Fix example tsconfig * Fix translate type error * Fix types, paths Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import NextDocument, { Html, Head, Main, NextScript, DocumentContext } from 'next/document'
|
|
import { getCssText } from 'styles'
|
|
import { GA_TRACKING_ID } from 'utils/gtag'
|
|
|
|
class MyDocument extends NextDocument {
|
|
static async getInitialProps(ctx: DocumentContext) {
|
|
const initialProps = await NextDocument.getInitialProps(ctx)
|
|
|
|
return {
|
|
...initialProps,
|
|
styles: (
|
|
<>
|
|
{initialProps.styles}
|
|
<style id="stitches" dangerouslySetInnerHTML={{ __html: getCssText() }} />
|
|
</>
|
|
),
|
|
}
|
|
}
|
|
|
|
render(): JSX.Element {
|
|
return (
|
|
<Html lang="en">
|
|
<Head>
|
|
<script async src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`} />
|
|
<script
|
|
dangerouslySetInnerHTML={{
|
|
__html: `
|
|
window.dataLayer = window.dataLayer || [];
|
|
function gtag(){dataLayer.push(arguments);}
|
|
gtag('js', new Date());
|
|
gtag('config', '${GA_TRACKING_ID}', {
|
|
page_path: window.location.pathname,
|
|
});
|
|
`,
|
|
}}
|
|
/>
|
|
</Head>
|
|
<body>
|
|
<Main />
|
|
<NextScript />
|
|
</body>
|
|
</Html>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default MyDocument
|