From 7d1bac186918830b30764a424da21dccfffbe268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=AB=E9=9B=A8=E6=B0=B4=E8=BF=87=E6=BB=A4=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E6=B0=94-Rain?= <958414905@qq.com> Date: Thu, 7 Sep 2023 08:46:58 +0800 Subject: [PATCH] chore(antd): reduce animation duration (#2602) --- packages/core/client/src/global-theme/defaultTheme.ts | 1 + packages/plugins/theme-editor/src/client/index.tsx | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/packages/core/client/src/global-theme/defaultTheme.ts b/packages/core/client/src/global-theme/defaultTheme.ts index 3e9ff030c..e899727af 100644 --- a/packages/core/client/src/global-theme/defaultTheme.ts +++ b/packages/core/client/src/global-theme/defaultTheme.ts @@ -16,6 +16,7 @@ const defaultTheme: ThemeConfig = { colorSettings: '#F18B62', colorBgSettingsHover: 'rgba(241, 139, 98, 0.06)', colorBorderSettingsHover: 'rgba(241, 139, 98, 0.3)', + motionUnit: 0.03, }, }; diff --git a/packages/plugins/theme-editor/src/client/index.tsx b/packages/plugins/theme-editor/src/client/index.tsx index a1d830d29..fd8f45f5a 100644 --- a/packages/plugins/theme-editor/src/client/index.tsx +++ b/packages/plugins/theme-editor/src/client/index.tsx @@ -2,10 +2,12 @@ import { Plugin, SettingsCenterProvider, createStyles, + defaultTheme, useCurrentUserSettingsMenu, useGlobalTheme, } from '@nocobase/client'; import { ConfigProvider } from 'antd'; +import _ from 'lodash'; import React, { useEffect, useMemo } from 'react'; import InitializeTheme from './components/InitializeTheme'; import { ThemeEditorProvider } from './components/ThemeEditorProvider'; @@ -78,6 +80,10 @@ const CustomThemeProvider = React.memo((props) => { ); + if (!theme?.token?.motionUnit) { + _.set(theme, 'token.motionUnit', defaultTheme.token.motionUnit); + } + return (