aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/views/common/Card.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-07-21 17:02:05 +0800
committercrupest <crupest@outlook.com>2023-07-21 17:02:05 +0800
commitd7b050ef7f047f841ffcda96fbdc9857574e97b9 (patch)
treeb37ccef507cbb6b9ca497715088ffe313e3d2011 /FrontEnd/src/views/common/Card.tsx
parent2226efed8c8604a938d060d62565b611722e837c (diff)
downloadtimeline-d7b050ef7f047f841ffcda96fbdc9857574e97b9.tar.gz
timeline-d7b050ef7f047f841ffcda96fbdc9857574e97b9.tar.bz2
timeline-d7b050ef7f047f841ffcda96fbdc9857574e97b9.zip
...
Diffstat (limited to 'FrontEnd/src/views/common/Card.tsx')
-rw-r--r--FrontEnd/src/views/common/Card.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/FrontEnd/src/views/common/Card.tsx b/FrontEnd/src/views/common/Card.tsx
index 5ff89b61..35e605af 100644
--- a/FrontEnd/src/views/common/Card.tsx
+++ b/FrontEnd/src/views/common/Card.tsx
@@ -1,22 +1,26 @@
import { ComponentPropsWithoutRef, Ref } from "react";
import classNames from "classnames";
+import { ThemeColor } from "./common";
import "./Card.css";
interface CardProps extends ComponentPropsWithoutRef<"div"> {
- containerRef?: Ref<HTMLDivElement> | null;
+ containerRef?: Ref<HTMLDivElement>;
+ color?: ThemeColor;
}
export default function Card({
+ color,
className,
children,
containerRef,
...otherProps
}: CardProps) {
+ color = color ?? "primary";
return (
<div
ref={containerRef}
- className={classNames("cru-card", className)}
+ className={classNames("cru-card", `cru-${color}`, className)}
{...otherProps}
>
{children}