Moved telemetry code to script.
This commit is contained in:
@@ -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 (
|
||||
<footer className={classNames(styles.footer, 'row')}>
|
||||
@@ -30,7 +30,7 @@ export default function Footer() {
|
||||
<div className={classNames(styles.version, 'col-12 col-md-4')}>
|
||||
<Link href={REPO_URL}>{`v${current}`}</Link>
|
||||
</div>
|
||||
{telemetryDisabled && <img src={`https://i.umami.is/a.png?v=${current}`} alt="" />}
|
||||
{!pathname.includes('/share/') && <Script src={`/telemetry.js?v=${current}`} />}
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user