More theme styles

This commit is contained in:
Sean Edmunds
2025-01-02 11:21:29 -06:00
parent 6899d7c7f0
commit cd1806b919

View File

@@ -1,5 +1,6 @@
import { ActionIcon, Box, Button, Group, Stack, Text } from '@mantine/core'; import { ActionIcon, Box, Button, Group, Overlay, Stack, Text } from '@mantine/core';
import { FiCheck, FiEdit, FiShuffle, FiTrash, FiX } from 'react-icons/fi'; import { useState } from 'react';
import { FiEdit, FiShuffle, FiTrash, FiX } from 'react-icons/fi';
import { actionIconClasses } from 'styles'; import { actionIconClasses } from 'styles';
function ThemeCard({ function ThemeCard({
@@ -11,8 +12,17 @@ function ThemeCard({
setValue, setValue,
createTheme, createTheme,
}: any) { }: any) {
const [hover, setHover] = useState(false);
return ( return (
<Group gap={0} align='center' justify='center' display={'grid'} pos={'relative'}> <Group
gap={0}
align='center'
justify='center'
display={'grid'}
pos={'relative'}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => setHover(false)}
>
<Text <Text
style={{ style={{
position: 'absolute', position: 'absolute',
@@ -32,8 +42,8 @@ function ThemeCard({
{cardTheme.name} {cardTheme.name}
</Text> </Text>
<Button <Button
w={'300px'} w={'275px'}
h={'125px'} h={'115px'}
disabled={currentTheme === 'random'} disabled={currentTheme === 'random'}
style={{ style={{
background: `linear-gradient(${cardTheme.backgroundColor}33, ${cardTheme.backgroundColor}33), no-repeat center url(/backgrounds/${cardTheme.backgroundImage})`, background: `linear-gradient(${cardTheme.backgroundColor}33, ${cardTheme.backgroundColor}33), no-repeat center url(/backgrounds/${cardTheme.backgroundImage})`,
@@ -46,6 +56,7 @@ function ThemeCard({
setValue(cardTheme.name); setValue(cardTheme.name);
}} }}
> >
{hover && currentTheme !== 'random' && <Overlay opacity={0.5} zIndex={0} />}
<Group w={'100%'} gap={0} display={'flex'} align='center' justify='center'> <Group w={'100%'} gap={0} display={'flex'} align='center' justify='center'>
<Stack align='center'> <Stack align='center'>
<Box <Box
@@ -177,10 +188,7 @@ function ThemeCard({
background: cardTheme.randomEnabled background: cardTheme.randomEnabled
? 'rgba(255,255,255,1)' ? 'rgba(255,255,255,1)'
: 'rgba(255,255,255,0.5)', : 'rgba(255,255,255,0.5)',
border: `solid 1px ${cardTheme.borderColor}`,
borderRadius: '2%',
margin: '2px', margin: '2px',
color: 'black',
}} }}
styles={{ styles={{
root: { root: {
@@ -203,7 +211,7 @@ function ThemeCard({
}); });
}} }}
> >
{cardTheme.randomEnabled ? <FiCheck color='green' /> : <FiX color='red' />} {cardTheme.randomEnabled ? <FiShuffle color='green' /> : <FiX color='red' />}
</ActionIcon> </ActionIcon>
<ActionIcon <ActionIcon
className={actionIconClasses.editButton} className={actionIconClasses.editButton}