More typing
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user