From 33e06a2b92c1907d63e551459b3394479d8cb73d Mon Sep 17 00:00:00 2001 From: Arnaud Benhamdine Date: Sat, 3 Dec 2022 12:36:03 +0100 Subject: [PATCH] chore(Drawer): Improve warning message wording and demo doc (#39207) * Improve warning message wording * Improve wording in demo * Fix test --- components/drawer/__tests__/Drawer.test.tsx | 2 +- components/drawer/demo/render-in-current.md | 2 +- components/drawer/index.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/drawer/__tests__/Drawer.test.tsx b/components/drawer/__tests__/Drawer.test.tsx index e4a66b7ae5..d0d58f63de 100644 --- a/components/drawer/__tests__/Drawer.test.tsx +++ b/components/drawer/__tests__/Drawer.test.tsx @@ -237,7 +237,7 @@ describe('Drawer', () => { render(); expect(errorSpy).toHaveBeenCalledWith( - 'Warning: [antd: Drawer] `style` is move to `rootStyle` in v5. Please confirm `position: absolute` is necessary.', + 'Warning: [antd: Drawer] `style` is replaced by `rootStyle` in v5. Please check that `position: absolute` is necessary.', ); errorSpy.mockRestore(); diff --git a/components/drawer/demo/render-in-current.md b/components/drawer/demo/render-in-current.md index b4e2bd421a..37befdbb4f 100644 --- a/components/drawer/demo/render-in-current.md +++ b/components/drawer/demo/render-in-current.md @@ -8,7 +8,7 @@ Render in current dom. custom container, check `getContainer`. -Note: `style` and `className` is move to Drawer panel in v5 which is align with Modal component. Origin `style` and `className` is replaced by `rootStyle` and `rootClassName`. +Note: `style` and `className` props are moved to Drawer panel in v5 which is aligned with Modal component. Original `style` and `className` props are replaced by `rootStyle` and `rootClassName`. ```css .site-drawer-render-in-current-wrapper { diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx index 037518d8ff..fbc89e87d1 100644 --- a/components/drawer/index.tsx +++ b/components/drawer/index.tsx @@ -98,7 +98,7 @@ function Drawer(props: DrawerProps) { warning( false, 'Drawer', - '`style` is move to `rootStyle` in v5. Please confirm `position: absolute` is necessary.', + '`style` is replaced by `rootStyle` in v5. Please check that `position: absolute` is necessary.', ); } }