mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 07:25:35 +00:00
feat: add i18n with type safety
This commit is contained in:
40
inertia/components/footer/footer.tsx
Normal file
40
inertia/components/footer/footer.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import PATHS from '#constants/paths';
|
||||
import styled from '@emotion/styled';
|
||||
import { Link } from '@inertiajs/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ExternalLink from '~/components/common/external_link';
|
||||
import packageJson from '../../../package.json';
|
||||
|
||||
const FooterStyle = styled.footer(({ theme }) => ({
|
||||
fontSize: '0.9em',
|
||||
color: theme.colors.grey,
|
||||
textAlign: 'center',
|
||||
paddingTop: '0.75em',
|
||||
}));
|
||||
|
||||
export default function Footer() {
|
||||
const { t } = useTranslation('common');
|
||||
|
||||
return (
|
||||
<FooterStyle>
|
||||
<div className="row">
|
||||
<Link href={PATHS.PRIVACY}>{t('privacy')}</Link>
|
||||
{' • '}
|
||||
<Link href={PATHS.TERMS}>{t('terms')}</Link>
|
||||
{' • '}
|
||||
<ExternalLink href={PATHS.EXTENSION}>Extension</ExternalLink>
|
||||
</div>
|
||||
<div className="row">
|
||||
{t('footer.made_by')}{' '}
|
||||
<ExternalLink href={PATHS.AUTHOR}>Sonny</ExternalLink>
|
||||
{' • '}
|
||||
<span>
|
||||
Version:{' '}
|
||||
<ExternalLink href={PATHS.REPO_GITHUB}>
|
||||
{packageJson.version}
|
||||
</ExternalLink>
|
||||
</span>
|
||||
</div>
|
||||
</FooterStyle>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user