diff --git a/src/components/config-provider/index.tsx b/src/components/config-provider/index.tsx index a17f7a4..1292222 100644 --- a/src/components/config-provider/index.tsx +++ b/src/components/config-provider/index.tsx @@ -1,63 +1,63 @@ import { ConfigProvider as AntdConfigProvider, ConfigProviderProps as AntdConfigProviderProps } from 'antd' -import { AntdToken, ThemeAppearance, useAntdToken, useThemeMode } from 'antd-style' +import { AntdToken, ThemeAppearance, useThemeMode } from 'antd-style' import type { OverrideToken } from 'antd/es/theme/interface' import type { FC, ReactNode } from 'react' import { ThemeProvider, createProAntdTheme, getProToken } from '@/theme' export const useProAntdTheme = (appearance: ThemeAppearance) => { - const token = useAntdToken() - const themeConfig = createProAntdTheme(appearance) - - const controlToken: Partial = { - // colorBgContainer: token?.colorFillQuaternary, - // colorBorder: 'transparent', - // controlOutline: 'transparent', - } - - themeConfig.components = { - Input: controlToken, - InputNumber: controlToken, - Select: controlToken, - Tree: { - colorBgContainer: 'transparent', - directoryNodeSelectedBg: '#e1f0ff', - directoryNodeSelectedColor: 'rgb(22, 62, 124)', - }, - TreeSelect: controlToken, - } - - return themeConfig + // const token = useAntdToken() + const themeConfig = createProAntdTheme(appearance) + + const controlToken: Partial = { + // colorBgContainer: token?.colorFillQuaternary, + // colorBorder: 'transparent', + // controlOutline: 'transparent', + } + + themeConfig.components = { + Input: controlToken, + InputNumber: controlToken, + Select: controlToken, + Tree: { + colorBgContainer: 'transparent', + directoryNodeSelectedBg: '#e1f0ff', + directoryNodeSelectedColor: 'rgb(22, 62, 124)', + }, + TreeSelect: controlToken, + } + + return themeConfig } export interface ConfigProviderProps extends AntdConfigProviderProps { - componentToken?: OverrideToken; - children: ReactNode; + componentToken?: OverrideToken; + children: ReactNode; } export const ConfigProvider: FC = ({ children, componentToken, ...props }) => { - const { appearance, themeMode } = useThemeMode() - const proTheme = useProAntdTheme(appearance) - proTheme.components = { ...proTheme.components, ...componentToken } - - return ( - - - {children} - - - ) + const { appearance, themeMode } = useThemeMode() + const proTheme = useProAntdTheme(appearance) + proTheme.components = { ...proTheme.components, ...componentToken } + + return ( + + + {children} + + + ) } export const withProvider = (Component) => (props) => { - return ( - - - - ) + return ( + + + + ) } \ No newline at end of file diff --git a/src/components/glass/index.tsx b/src/components/glass/index.tsx index 317a702..4f5f7b2 100644 --- a/src/components/glass/index.tsx +++ b/src/components/glass/index.tsx @@ -17,21 +17,21 @@ const Glass = (props: IClassProps) => { } return ( -
- - {props.description} - -
- {props.children} -
+
+ + {props.description} + +
+ {props.children} +
) } -export const withGlass = (Component: React.Component | React.FC | JSX.Element | React.ReactNode) => (props) => { +export const withGlass = (Component: any) => (props) => { return ( - - - + + + ) } diff --git a/src/components/icon/picker/PickerPanel.tsx b/src/components/icon/picker/PickerPanel.tsx index bcf2a18..5375a3d 100644 --- a/src/components/icon/picker/PickerPanel.tsx +++ b/src/components/icon/picker/PickerPanel.tsx @@ -11,64 +11,64 @@ import { usePickerContext } from './context.tsx' const PickerPanel = () => { - const { - state: { icon, panelTabKey, }, - actions: { resetIcon, changePanelTab, isEmptyIconAntdList, isEmptyIconParkList } - } = usePickerContext() + const { + state: { icon, panelTabKey, }, + actions: { resetIcon, changePanelTab, isEmptyIconAntdList, isEmptyIconParkList } + } = usePickerContext() - const token = useToken() + const token = useToken() - return ( - - {icon ? ( - - - -
{getIconName(icon)}
-
- -
- ) : undefined} - }, - { label: 'Icon Park', value: 'park' }, - ]} - value={panelTabKey} - onChange={(key) => { - changePanelTab(key as any) - }} - block - /> + return ( + + {icon ? ( + + + +
{getIconName(icon as any)}
+
+ +
+ ) : undefined} + }, + { label: 'Icon Park', value: 'park' }, + ]} + value={panelTabKey} + onChange={(key) => { + changePanelTab(key as any) + }} + block + /> - {(isEmptyIconAntdList || isEmptyIconParkList) ? ( - ( - - ) - ) : ( - <> - - - - - - )} -
- ) + {(isEmptyIconAntdList || isEmptyIconParkList) ? ( + ( + + ) + ) : ( + <> + + + + + + )} +
+ ) } export default PickerPanel \ No newline at end of file diff --git a/src/pages/dashboard/index.tsx b/src/pages/dashboard/index.tsx index 697cde6..2cd3a5f 100644 --- a/src/pages/dashboard/index.tsx +++ b/src/pages/dashboard/index.tsx @@ -4,21 +4,22 @@ import { createFileRoute } from '@tanstack/react-router' const Index = () => { return ( - <> - + <> + -

Dashboard

+

Dashboard

-
- +
+ ) } +// @ts-ignore export const Route = createFileRoute('/dashboard')({ component: Index, }) diff --git a/tsconfig.json b/tsconfig.json index 0d1c963..0ef4938 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,10 +2,13 @@ "compilerOptions": { "target": "ES2020", "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], + "lib": [ + "ES2020", + "DOM", + "DOM.Iterable" + ], "module": "ESNext", "skipLibCheck": true, - /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, @@ -13,7 +16,6 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", - /* Linting */ "noImplicitAny": false, "strict": true, @@ -21,14 +23,21 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "allowSyntheticDefaultImports": true, - /* Type checking */ "strictNullChecks": true, - "files": [ "./src/**/*.d.ts"], + // "files": [ "./src/**/*.d.ts"], "paths": { - "@/*": ["./src/*"] + "@/*": [ + "./src/*" + ] } }, - "include": ["./src"], - "references": [{ "path": "./tsconfig.node.json" }] + "include": [ + "./src" + ], + "references": [ + { + "path": "./tsconfig.node.json" + } + ] }