mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 15:05:35 +00:00
refactor: remove all legacy files
+ comment/delete things that haven't yet migrated to mantine
This commit is contained in:
@@ -1,44 +1,58 @@
|
||||
import PATHS from '#constants/paths';
|
||||
import styled from '@emotion/styled';
|
||||
import { Link } from '@inertiajs/react';
|
||||
import { route } from '@izzyjs/route/client';
|
||||
import { Anchor, Group, Text } from '@mantine/core';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ExternalLink from '~/components/common/external_link';
|
||||
import { MantineLanguageSwitcher } from '~/components/common/language_switcher';
|
||||
import { MantineThemeSwitcher } from '~/components/common/theme_switcher';
|
||||
import packageJson from '../../../package.json';
|
||||
import classes from './footer.module.css';
|
||||
|
||||
const FooterStyle = styled.footer(({ theme }) => ({
|
||||
fontSize: '0.9em',
|
||||
color: theme.colors.grey,
|
||||
textAlign: 'center',
|
||||
paddingBlock: '0.75em',
|
||||
'& a:hover': {
|
||||
textDecoration: 'underline',
|
||||
},
|
||||
}));
|
||||
|
||||
export default function Footer({ className }: { className?: string }) {
|
||||
export function MantineFooter() {
|
||||
const { t } = useTranslation('common');
|
||||
|
||||
const links = [
|
||||
{ link: route('privacy').url, label: t('privacy') },
|
||||
{ link: route('terms').url, label: t('terms') },
|
||||
{ link: PATHS.EXTENSION, label: 'Extension' },
|
||||
];
|
||||
|
||||
const items = links.map((link) => (
|
||||
<Anchor
|
||||
c="dimmed"
|
||||
component={Link}
|
||||
key={link.label}
|
||||
href={link.link}
|
||||
size="sm"
|
||||
>
|
||||
{link.label}
|
||||
</Anchor>
|
||||
));
|
||||
|
||||
return (
|
||||
<FooterStyle className={className}>
|
||||
<div className="row">
|
||||
<Link href={route('privacy').url}>{t('privacy')}</Link>
|
||||
{' • '}
|
||||
<Link href={route('terms').url}>{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}>
|
||||
<div className={classes.footer}>
|
||||
<div className={classes.inner}>
|
||||
<Group gap={4} c="dimmed">
|
||||
<Text size="sm">{t('footer.made_by')}</Text>{' '}
|
||||
<Anchor size="sm" component={ExternalLink} href={PATHS.AUTHOR}>
|
||||
Sonny
|
||||
</Anchor>
|
||||
{' • '}
|
||||
<Anchor size="sm" component={ExternalLink} href={PATHS.REPO_GITHUB}>
|
||||
{packageJson.version}
|
||||
</ExternalLink>
|
||||
</span>
|
||||
</Anchor>
|
||||
</Group>
|
||||
|
||||
<Group gap="sm" mt={4} mb={4}>
|
||||
<MantineThemeSwitcher />
|
||||
<MantineLanguageSwitcher />
|
||||
</Group>
|
||||
|
||||
<Group gap="xs" justify="flex-end" wrap="nowrap">
|
||||
{items}
|
||||
</Group>
|
||||
</div>
|
||||
</FooterStyle>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user