diff --git a/packages/core/client/src/style/theme/defaultTheme.ts b/packages/core/client/src/style/theme/defaultTheme.ts index 2309614bd..2e12caa91 100644 --- a/packages/core/client/src/style/theme/defaultTheme.ts +++ b/packages/core/client/src/style/theme/defaultTheme.ts @@ -14,8 +14,8 @@ const defaultTheme: ThemeConfig = { // UI 配置组件 colorSettings: '#2196f3', - colorBgSettingsHover: 'rgba(241, 139, 98, 0.06)', - colorBorderSettingsHover: 'rgba(241, 139, 98, 0.3)', + colorBgSettingsHover: 'rgba(33,150,243, 0.06)', + colorBorderSettingsHover: 'rgba(33,150,243, 0.3)', motionUnit: 0.03, motion: !process.env.__E2E__, }, diff --git a/packages/core/client/src/style/theme/index.tsx b/packages/core/client/src/style/theme/index.tsx index b7deec1a7..a584acc59 100644 --- a/packages/core/client/src/style/theme/index.tsx +++ b/packages/core/client/src/style/theme/index.tsx @@ -1,4 +1,4 @@ -import React, { createContext, useCallback, useMemo, useRef } from 'react'; +import React, { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react'; import { theme as antdTheme, ConfigProvider } from 'antd'; import _ from 'lodash'; @@ -29,11 +29,11 @@ const GlobalThemeContext = createContext(null); GlobalThemeContext.displayName = 'GlobalThemeContext'; export const useGlobalTheme = () => { - return React.useContext(GlobalThemeContext) || ({ theme: {}, isDarkTheme: false } as GlobalThemeContextProps); + return useContext(GlobalThemeContext) || ({ theme: {}, isDarkTheme: false } as GlobalThemeContextProps); }; export const GlobalThemeProvider = ({ children, theme: themeFromProps }) => { - const [theme, setTheme] = React.useState(themeFromProps || defaultTheme); + const [theme, setTheme] = useState(themeFromProps || defaultTheme); const currentSettingThemeRef = useRef(null); const currentEditingThemeRef = useRef(null); @@ -82,7 +82,9 @@ export const GlobalThemeProvider = ({ children, theme: themeFromProps }) => { return ( - {children} + + {children} + ); }; diff --git a/packages/core/client/src/style/theme/type.ts b/packages/core/client/src/style/theme/type.ts index 60d55f4bd..acb5b042c 100644 --- a/packages/core/client/src/style/theme/type.ts +++ b/packages/core/client/src/style/theme/type.ts @@ -33,6 +33,5 @@ export interface ThemeConfig extends _ThemeConfig { } declare module 'antd-style' { - // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface CustomToken extends TachybaseToken {} }