mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Moved telemetry code to script.
This commit is contained in:
parent
3d7e9392f0
commit
a4a6888248
4 changed files with 25 additions and 11 deletions
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue