2023-01-19 00:05:39 +01:00
|
|
|
import { Row, Column } from 'react-basics';
|
2022-08-02 09:24:17 +02:00
|
|
|
import { useRouter } from 'next/router';
|
|
|
|
import Script from 'next/script';
|
2020-10-03 19:53:06 +02:00
|
|
|
import classNames from 'classnames';
|
2023-01-19 00:05:39 +01:00
|
|
|
import { useIntl, defineMessages } from 'react-intl';
|
2020-09-16 05:34:30 +02:00
|
|
|
import Link from 'components/common/Link';
|
2022-08-08 20:31:36 +02:00
|
|
|
import { CURRENT_VERSION, HOMEPAGE_URL, REPO_URL } from 'lib/constants';
|
2023-01-19 00:05:39 +01:00
|
|
|
import styles from './Footer.module.css';
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
poweredBy: { id: 'message.powered-by', defaultMessage: 'Powered by {name}' },
|
|
|
|
});
|
2020-08-07 11:27:12 +02:00
|
|
|
|
2023-01-19 00:05:39 +01:00
|
|
|
export default function Footer({ className }) {
|
2022-08-02 09:24:17 +02:00
|
|
|
const { pathname } = useRouter();
|
2023-01-19 00:05:39 +01:00
|
|
|
const { formatMessage } = useIntl();
|
2021-05-13 08:15:37 +02:00
|
|
|
|
2020-08-07 11:27:12 +02:00
|
|
|
return (
|
2023-01-19 00:05:39 +01:00
|
|
|
<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>
|
2022-08-08 20:31:36 +02:00
|
|
|
{!pathname.includes('/share/') && <Script src={`/telemetry.js`} />}
|
2020-08-07 11:27:12 +02:00
|
|
|
</footer>
|
|
|
|
);
|
|
|
|
}
|