diff --git a/src/components/Dashboard/Tiles/HomarrCardWrapper.tsx b/src/components/Dashboard/Tiles/HomarrCardWrapper.tsx index d5f100b6a..07f9eee69 100644 --- a/src/components/Dashboard/Tiles/HomarrCardWrapper.tsx +++ b/src/components/Dashboard/Tiles/HomarrCardWrapper.tsx @@ -5,18 +5,20 @@ import { useEditModeStore } from '../Views/useEditModeStore'; interface HomarrCardWrapperProps extends CardProps { children: ReactNode; + isCategory?: boolean; } export const HomarrCardWrapper = ({ ...props }: HomarrCardWrapperProps) => { + const { isCategory = false, ...restProps } = props; const { cx, classes: { card: cardClass }, - } = useCardStyles(); + } = useCardStyles(isCategory); const isEditMode = useEditModeStore((x) => x.enabled); return ( { const isEditMode = useEditModeStore((x) => x.enabled); return ( - + {category.name} {isEditMode ? : null} diff --git a/src/components/layout/useCardStyles.ts b/src/components/layout/useCardStyles.ts index c861a84e9..2c842e422 100644 --- a/src/components/layout/useCardStyles.ts +++ b/src/components/layout/useCardStyles.ts @@ -1,21 +1,34 @@ import { createStyles } from '@mantine/core'; import { useConfigContext } from '../../config/provider'; -export const useCardStyles = () => { +export const useCardStyles = (isCategory: boolean) => { const { config } = useConfigContext(); const appOpacity = config?.settings.customization.appOpacity; return createStyles(({ colorScheme }, _params) => { const opacity = (appOpacity || 100) / 100; + + if (colorScheme === 'dark') { + if (isCategory) { + return { + card: { + backgroundColor: `rgba(32, 33, 35, ${opacity}) !important`, + borderColor: `rgba(37, 38, 43, ${opacity})`, + }, + }; + } + + return { + card: { + backgroundColor: `rgba(37, 38, 43, ${opacity}) !important`, + borderColor: `rgba(37, 38, 43, ${opacity})`, + }, + }; + } + return { card: { - backgroundColor: - colorScheme === 'dark' - ? `rgba(37, 38, 43, ${opacity}) !important` - : `rgba(255, 255, 255, ${opacity}) !important`, - borderColor: - colorScheme === 'dark' - ? `rgba(37, 38, 43, ${opacity})` - : `rgba(233, 236, 239, ${opacity})`, + backgroundColor: `rgba(255, 255, 255, ${opacity}) !important`, + borderColor: `rgba(233, 236, 239, ${opacity})`, }, }; })();