|
1 | | -import { Html, Head, Main, NextScript } from 'next/document' |
2 | | -import { ENV_CONFIG } from 'common/envs/constants' |
| 1 | +import {Head, Html, Main, NextScript} from 'next/document' |
| 2 | +import {ENV_CONFIG, IS_DEPLOYED} from 'common/envs/constants' |
3 | 3 | import Script from 'next/script' |
4 | 4 |
|
5 | 5 | export default function Document() { |
6 | 6 | return ( |
7 | 7 | <Html lang="en"> |
8 | 8 | <Head> |
9 | | - <link rel="icon" href={ENV_CONFIG.faviconPath} /> |
| 9 | + <link rel="icon" href={ENV_CONFIG.faviconPath}/> |
10 | 10 | <link |
11 | 11 | // href="https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;500;600;700&display=swap" |
12 | 12 | href="https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:wght@400;500;600;700&display=swap" |
13 | 13 | // href="https://fonts.googleapis.com/css2?family=Merriweather:wght@400;500;600;700&display=swap" |
14 | 14 | // href="https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;600;700&display=swap" |
15 | 15 | rel="stylesheet" |
16 | 16 | /> |
17 | | - <Script src="/init-theme.js" strategy="beforeInteractive" /> |
| 17 | + <Script src="/init-theme.js" strategy="beforeInteractive"/> |
| 18 | + {IS_DEPLOYED && <Script id="devtools-warning" strategy="afterInteractive" dangerouslySetInnerHTML={{ |
| 19 | + __html: `(() => { try { |
| 20 | + const title = 'Hold Up!'; |
| 21 | + const msg1 = "If someone told you to copy/paste something here you have an 11/10 chance you're being scammed."; |
| 22 | + const msg2 = 'Pasting anything in here could give attackers access to your Compass account.'; |
| 23 | + const msg3 = 'Unless you understand exactly what you are doing, close this window and stay safe.'; |
| 24 | + const styleText = 'font-size:24px;font-weight:700;padding:8px 12px;border-radius:4px;'; |
| 25 | + const styleTitle = 'color:#d32f2f;font-size:28px;font-weight:700;padding:8px 12px;border-radius:4px;'; |
| 26 | + console.log('%c' + title, styleTitle); |
| 27 | + console.log('%c' + msg1, styleText); |
| 28 | + console.log('%c' + msg2, styleTitle); |
| 29 | + console.log('%c' + msg3, styleText); |
| 30 | + } catch(e){} })();` |
| 31 | + }}/>} |
18 | 32 | </Head> |
19 | 33 | <body className="body-bg text-ink-1000"> |
20 | | - <Main /> |
21 | | - <NextScript /> |
| 34 | + <Main/> |
| 35 | + <NextScript/> |
22 | 36 | </body> |
23 | 37 | </Html> |
24 | 38 | ) |
|
0 commit comments