🐛 Fix colors of card wrapper when category

This commit is contained in:
Manuel Ruwe
2022-12-30 17:04:56 +01:00
parent 42a16e0015
commit c8d35f4aad
3 changed files with 29 additions and 14 deletions

View File

@@ -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})`,
},
};
})();