More typing

This commit is contained in:
2025-04-15 22:16:27 -05:00
parent 78dec160b6
commit 4e9df7256b
27 changed files with 235 additions and 110 deletions

View File

@@ -1,6 +1,13 @@
import { Group, Text } from '@mantine/core';
function ThemeMiniCard({ allThemes, item }: any) {
const theme = allThemes.find((theme: any) => theme.id === item);
import type { Theme } from 'types';
function ThemeMiniCard({
allThemes,
item,
}: {
allThemes: Theme[];
item: number;
}) {
const theme = allThemes.find((theme: Theme) => theme.id === item);
return (
<Group
@@ -12,23 +19,23 @@ function ThemeMiniCard({ allThemes, item }: any) {
w={'175px'}
h={'60px'}
style={{
background: `linear-gradient(${theme.backgroundColor}33, ${theme.backgroundColor}33), no-repeat center url(/backgrounds/${theme.backgroundImage})`,
background: `linear-gradient(${theme?.backgroundColor}33, ${theme?.backgroundColor}33), no-repeat center url(/backgrounds/${theme?.backgroundImage})`,
backgroundSize: 'cover',
backgroundColor: theme.backgroundColor,
border: `solid ${theme.borderColor}`,
backgroundColor: theme?.backgroundColor,
border: `solid ${theme?.borderColor}`,
borderRadius: '8px',
}}
>
<Text
bg={theme.backgroundColor}
c={theme.primaryColor}
bg={theme?.backgroundColor}
c={theme?.primaryColor}
size='md'
style={{
padding: 4,
borderRadius: '8px',
}}
>
{allThemes.find((theme: any) => theme.id === item)?.name}
{allThemes.find((theme: Theme) => theme.id === item)?.name}
</Text>
</Group>
);