mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
Merge remote-tracking branch 'origin/feature' into next-merge-feature
This commit is contained in:
@@ -100,10 +100,9 @@ const ThemeSwitch: React.FC<ThemeSwitchProps> = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
lastThemeKey.current = key;
|
||||
|
||||
// 亮色/暗色模式切换时应用动画效果
|
||||
if (key === 'dark' || key === 'light') {
|
||||
lastThemeKey.current = key;
|
||||
toggleAnimationTheme(domEvent, theme.includes('dark'));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ export function resetWarned() {
|
||||
|
||||
type Warning = (valid: boolean, component: string, message?: string) => void;
|
||||
|
||||
// eslint-disable-next-line import/no-mutable-exports
|
||||
let warning: Warning = noop;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
warning = (valid, component, message) => {
|
||||
|
||||
41
components/config-provider/__tests__/motion.test.tsx
Normal file
41
components/config-provider/__tests__/motion.test.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import React from 'react';
|
||||
|
||||
import ConfigProvider from '..';
|
||||
import { pureRender } from '../../../tests/utils';
|
||||
|
||||
let MotionProviderRun = 0;
|
||||
jest.mock('rc-motion', () => {
|
||||
const RcMotion = jest.requireActual('rc-motion');
|
||||
const MotionProvider = RcMotion.Provider;
|
||||
return {
|
||||
...RcMotion,
|
||||
Provider: (props: any) => {
|
||||
MotionProviderRun += 1;
|
||||
return <MotionProvider {...props} />;
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
describe('motion test', () => {
|
||||
beforeEach(() => {
|
||||
MotionProviderRun = 0;
|
||||
});
|
||||
|
||||
it('nest motion properties, should work fine', () => {
|
||||
pureRender(
|
||||
<>
|
||||
<ConfigProvider theme={{ token: { motion: false } }}>
|
||||
<ConfigProvider>
|
||||
<ConfigProvider theme={{ token: { motion: true } }}>
|
||||
<ConfigProvider theme={{ token: { motion: false } }}>
|
||||
<ConfigProvider />
|
||||
</ConfigProvider>
|
||||
</ConfigProvider>
|
||||
</ConfigProvider>
|
||||
</ConfigProvider>
|
||||
</>,
|
||||
);
|
||||
|
||||
expect(MotionProviderRun).toBe(3);
|
||||
});
|
||||
});
|
||||
@@ -335,7 +335,6 @@ methods.forEach((type: keyof MessageMethods) => {
|
||||
const noop = () => {};
|
||||
|
||||
/** @internal Only Work in test env */
|
||||
// eslint-disable-next-line import/no-mutable-exports
|
||||
export let actWrapper: (wrapper: any) => void = noop;
|
||||
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
@@ -345,7 +344,6 @@ if (process.env.NODE_ENV === 'test') {
|
||||
}
|
||||
|
||||
/** @internal Only Work in test env */
|
||||
// eslint-disable-next-line import/no-mutable-exports
|
||||
export let actDestroy = noop;
|
||||
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
|
||||
@@ -257,7 +257,6 @@ methods.forEach((type: keyof NoticeMethods) => {
|
||||
const noop = () => {};
|
||||
|
||||
/** @internal Only Work in test env */
|
||||
// eslint-disable-next-line import/no-mutable-exports
|
||||
export let actWrapper: (wrapper: any) => void = noop;
|
||||
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
@@ -267,7 +266,6 @@ if (process.env.NODE_ENV === 'test') {
|
||||
}
|
||||
|
||||
/** @internal Only Work in test env */
|
||||
// eslint-disable-next-line import/no-mutable-exports
|
||||
export let actDestroy = noop;
|
||||
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint import/no-unresolved: 0 */
|
||||
// @ts-ignore
|
||||
import version from './version';
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
"@microflash/rehype-figure": "^2.1.1",
|
||||
"@npmcli/run-script": "^9.0.1",
|
||||
"@octokit/rest": "^22.0.0",
|
||||
"@prettier/sync": "^0.5.4",
|
||||
"@prettier/sync": "^0.6.1",
|
||||
"@qixian.cs/github-contributors-list": "^2.0.2",
|
||||
"@size-limit/file": "^11.1.6",
|
||||
"@stackblitz/sdk": "^1.11.0",
|
||||
|
||||
Reference in New Issue
Block a user