diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a70a0f82..402939fb 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -18,10 +18,10 @@ const config = { rules: { 'import/order': ['error', { groups: [['builtin', 'external', 'internal']] }], 'import/newline-after-import': 'error', - 'eol-last': ["error", "always"], + 'eol-last': ['error', 'always'], }, // This is because `next.config.mjs` is excluded from tsconfig. - ignorePatterns: ['next.config.mjs', 'next-i18next.config.js'], + ignorePatterns: ['next.config.mjs', 'next-i18next.config.js', 'public/scripts/*'], } module.exports = config diff --git a/public/scripts/google-analytics.js b/public/scripts/google-analytics.js new file mode 100644 index 00000000..f89fbb44 --- /dev/null +++ b/public/scripts/google-analytics.js @@ -0,0 +1,7 @@ +window.dataLayer = window.dataLayer || [] +function gtag() { + dataLayer.push(arguments) +} +gtag('js', new Date()) + +gtag('config', 'G-WVH440CNZ3') diff --git a/public/scripts/twitter.js b/public/scripts/twitter.js new file mode 100644 index 00000000..24aa7d04 --- /dev/null +++ b/public/scripts/twitter.js @@ -0,0 +1,15 @@ +!(function (e, t, n, s, u, a) { + e.twq || + ((s = e.twq = + function () { + s.exe ? s.exe.apply(s, arguments) : s.queue.push(arguments) + }), + (s.version = '1.1'), + (s.queue = []), + (u = t.createElement(n)), + (u.async = !0), + (u.src = 'https://static.ads-twitter.com/uwt.js'), + (a = t.getElementsByTagName(n)[0]), + a.parentNode.insertBefore(u, a)) +})(window, document, 'script') +twq('config', 'o6uy5') diff --git a/src/pages/_app.page.tsx b/src/pages/_app.page.tsx index c41db49b..c67cf1fa 100644 --- a/src/pages/_app.page.tsx +++ b/src/pages/_app.page.tsx @@ -1,6 +1,7 @@ -import { useEffect } from 'react' import { type AppType } from 'next/app' +import { useEffect } from 'react' import Head from 'next/head' +import Script from 'next/script' import { appWithTranslation } from 'next-i18next' import localFont from 'next/font/local' import { api } from '../utils/api' @@ -29,6 +30,9 @@ const App: AppType = ({ Component, pageProps }) => {