diff options
author | crupest <crupest@outlook.com> | 2023-07-21 17:02:05 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-07-21 17:02:05 +0800 |
commit | d7b050ef7f047f841ffcda96fbdc9857574e97b9 (patch) | |
tree | b37ccef507cbb6b9ca497715088ffe313e3d2011 /FrontEnd/src/views/common/Card.tsx | |
parent | 2226efed8c8604a938d060d62565b611722e837c (diff) | |
download | timeline-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.tsx | 8 |
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} |