feat: Implement theme toggling and enhance dashboard component theming
This commit introduces a theme toggle functionality in the application header and improves the visual consistency of dashboard components across different color schemes. - Added light/dark mode toggle to using Mantine's . - Ensured all components in have visible borders in both light and dark modes by adding the prop. - Made colors in theme-aware, dynamically adjusting their background color based on the active color scheme. Additionally, this commit includes a large refactoring operation, moving various component files from to and updating their references.
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
import {
|
||||
Badge as MantineBadge,
|
||||
type BadgeProps as MantineBadgeProps,
|
||||
} from "@mantine/core";
|
||||
import { cn } from "./utils";
|
||||
|
||||
interface BadgeProps extends MantineBadgeProps {
|
||||
variant?: "default" | "secondary" | "destructive" | "success";
|
||||
}
|
||||
|
||||
const Badge = ({
|
||||
className,
|
||||
variant = "default",
|
||||
children,
|
||||
...props
|
||||
}: BadgeProps) => {
|
||||
let mantineVariant: MantineBadgeProps["variant"];
|
||||
let mantineColor: MantineBadgeProps["color"];
|
||||
|
||||
switch (variant) {
|
||||
case "secondary":
|
||||
mantineVariant = "light";
|
||||
mantineColor = "gray";
|
||||
break;
|
||||
case "destructive":
|
||||
mantineVariant = "filled";
|
||||
mantineColor = "red";
|
||||
break;
|
||||
case "success":
|
||||
mantineVariant = "filled";
|
||||
mantineColor = "green";
|
||||
break;
|
||||
default:
|
||||
mantineVariant = "filled";
|
||||
mantineColor = "blue"; // Placeholder, should align with primary color
|
||||
break;
|
||||
}
|
||||
|
||||
return (
|
||||
<MantineBadge
|
||||
variant={mantineVariant}
|
||||
color={mantineColor}
|
||||
className={cn(className)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</MantineBadge>
|
||||
);
|
||||
};
|
||||
|
||||
export { Badge };
|
||||
Reference in New Issue
Block a user