From a4a68882483478116d8cef9b7f65c31216704847 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Tue, 2 Aug 2022 00:24:17 -0700 Subject: [PATCH] Moved telemetry code to script. --- components/layout/Footer.js | 8 ++++---- lib/constants.js | 1 + next.config.js | 13 ++++++------- pages/api/scripts/telemetry.js | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 11 deletions(-) create mode 100644 pages/api/scripts/telemetry.js diff --git a/components/layout/Footer.js b/components/layout/Footer.js index e7d0b14f..f9c2ba87 100644 --- a/components/layout/Footer.js +++ b/components/layout/Footer.js @@ -1,15 +1,15 @@ -import React from 'react'; +import { useRouter } from 'next/router'; +import Script from 'next/script'; import classNames from 'classnames'; import { FormattedMessage } from 'react-intl'; import Link from 'components/common/Link'; import styles from './Footer.module.css'; import useStore from 'store/version'; import { HOMEPAGE_URL, REPO_URL } from 'lib/constants'; -import useConfig from 'hooks/useConfig'; export default function Footer() { const { current } = useStore(); - const { telemetryDisabled } = useConfig(); + const { pathname } = useRouter(); return (