重构:提交全新项目代码
This commit is contained in:
18
packages/ui-web/src/component/theme/Theme.tsx
Normal file
18
packages/ui-web/src/component/theme/Theme.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { cn } from "tailwind-variants";
|
||||
import { ThemeContext } from "./ThemeContext";
|
||||
import { ReactNode } from "react";
|
||||
|
||||
type ThemeProps = {
|
||||
theme?: "light" | "dark";
|
||||
children?: ReactNode;
|
||||
};
|
||||
|
||||
export const Theme = (props: ThemeProps) => {
|
||||
const { theme = "light", children } = props;
|
||||
const themeCls = cn(theme, "brand-default") as string;
|
||||
return (
|
||||
<ThemeContext.Provider value={{ themeCls }}>
|
||||
<div className={themeCls}>{children}</div>
|
||||
</ThemeContext.Provider>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user