refactor: remove all legacy files

+ comment/delete things that haven't yet migrated to mantine
This commit is contained in:
Sonny
2024-11-07 00:29:58 +01:00
committed by Sonny
parent 861906d29b
commit 5c37fe9c31
148 changed files with 469 additions and 4728 deletions

View File

@@ -0,0 +1,48 @@
import { Text, ThemeIcon, rem } from '@mantine/core';
import { useTranslation } from 'react-i18next';
import { AiFillFolderOpen } from 'react-icons/ai';
import { FaUser } from 'react-icons/fa';
import { IoIosLink, IoIosSearch, IoIosShareAlt } from 'react-icons/io';
import { IoExtensionPuzzleOutline } from 'react-icons/io5';
import { featureList } from '~/components/home/feature_list';
type FeatureName = (typeof featureList)[number];
function getIcon(name: FeatureName) {
switch (name) {
case 'collection':
return AiFillFolderOpen;
case 'link':
return IoIosLink;
case 'search':
return IoIosSearch;
case 'extension':
return IoExtensionPuzzleOutline;
case 'share':
return IoIosShareAlt;
case 'contribute':
return FaUser;
}
}
interface FeatureProps {
name: FeatureName;
}
export function Feature({ name: featureName }: FeatureProps) {
const { t } = useTranslation('about');
const Icon = getIcon(featureName);
return (
<div>
<ThemeIcon variant="light" size={40} radius={40}>
<Icon style={{ width: rem(18), height: rem(18) }} />
</ThemeIcon>
<Text mt="sm" mb={7}>
{t(`${featureName}.title`)}
</Text>
<Text size="sm" c="dimmed" lh={1.6}>
{t(`${featureName}.text`)}
</Text>
</div>
);
}

View File

@@ -0,0 +1,24 @@
import { SimpleGrid } from '@mantine/core';
import { Feature } from '~/components/home/feature';
export const featureList = [
'collection',
'link',
'search',
'extension',
'share',
'contribute',
] as const;
export const FeatureList = () => (
<SimpleGrid
mt={60}
cols={{ base: 1, sm: 2, md: 3 }}
spacing={{ base: 'xl', md: 50 }}
verticalSpacing={{ base: 'xl', md: 50 }}
>
{featureList.map((feature, index) => (
<Feature name={feature} key={index} />
))}
</SimpleGrid>
);