diff --git a/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap b/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap index 087e968daa..41a4deae36 100644 --- a/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap +++ b/components/drawer/__tests__/__snapshots__/demo-extend.test.tsx.snap @@ -2902,7 +2902,7 @@ Array [ exports[`renders ./components/drawer/demo/render-in-current.tsx extend context correctly 1`] = `
Render in this
Render in this
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 { - position: relative; - height: 200px; - padding: 48px; - overflow: hidden; - text-align: center; - background: #fafafa; - border: 1px solid #ebedf0; - border-radius: 2px; -} -``` - - diff --git a/components/drawer/demo/render-in-current.tsx b/components/drawer/demo/render-in-current.tsx index 024918a2aa..3e4cfb426d 100644 --- a/components/drawer/demo/render-in-current.tsx +++ b/components/drawer/demo/render-in-current.tsx @@ -1,7 +1,8 @@ import React, { useState } from 'react'; -import { Button, Drawer } from 'antd'; +import { Button, Drawer, theme } from 'antd'; const App: React.FC = () => { + const { token } = theme.useToken(); const [open, setOpen] = useState(false); const showDrawer = () => { @@ -12,8 +13,19 @@ const App: React.FC = () => { setOpen(false); }; + const containerStyle: React.CSSProperties = { + position: 'relative', + height: 200, + padding: 48, + overflow: 'hidden', + textAlign: 'center', + background: token.colorFillAlter, + border: `1px solid ${token.colorBorderSecondary}`, + borderRadius: token.borderRadiusLG, + }; + return ( -
+
Render in this