mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-25 02:36:20 +01:00
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
import { Row, Column } from 'react-basics';
|
|
import { useRouter } from 'next/router';
|
|
import Script from 'next/script';
|
|
import classNames from 'classnames';
|
|
import { useIntl, defineMessages } from 'react-intl';
|
|
import Link from 'components/common/Link';
|
|
import { CURRENT_VERSION, HOMEPAGE_URL, REPO_URL } from 'lib/constants';
|
|
import styles from './Footer.module.css';
|
|
|
|
const messages = defineMessages({
|
|
poweredBy: { id: 'message.powered-by', defaultMessage: 'Powered by {name}' },
|
|
});
|
|
|
|
export default function Footer({ className }) {
|
|
const { pathname } = useRouter();
|
|
const { formatMessage } = useIntl();
|
|
|
|
return (
|
|
<footer className={classNames(styles.footer, className)}>
|
|
<Row>
|
|
<Column>
|
|
<div>
|
|
{formatMessage(messages.poweredBy, {
|
|
name: (
|
|
<Link href={HOMEPAGE_URL}>
|
|
<b>umami</b>
|
|
</Link>
|
|
),
|
|
})}
|
|
</div>
|
|
</Column>
|
|
<Column className={styles.version}>
|
|
<Link href={REPO_URL}>{`v${CURRENT_VERSION}`}</Link>
|
|
</Column>
|
|
</Row>
|
|
{!pathname.includes('/share/') && <Script src={`/telemetry.js`} />}
|
|
</footer>
|
|
);
|
|
}
|