refactor: rewrite inline-style to cssinjs (#48832)

* refactor: rewrite inline-style to cssinjs

* test: fix snap
This commit is contained in:
lijianan 2024-05-09 10:12:26 +08:00 committed by GitHub
parent 300ec22f33
commit b87dbc91ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 14 deletions

View File

@ -157,18 +157,7 @@ const DrawerPanel: React.FC<DrawerPanelProps> = (props) => {
}, [footer, footerStyle, prefixCls]);
if (spinProps?.spinning) {
return (
<Spin
spinning={false}
style={{
height: '100%',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
{...spinProps}
/>
);
return <Spin {...spinProps} />;
}
return (

View File

@ -27,7 +27,6 @@ exports[`Drawer Drawer loading have a spinner 1`] = `
aria-busy="true"
aria-live="polite"
class="ant-spin ant-spin-spinning"
style="height: 100%; display: flex; justify-content: center; align-items: center;"
>
<span
class="ant-spin-dot ant-spin-dot-spin"

View File

@ -2817,7 +2817,6 @@ Array [
aria-busy="true"
aria-live="polite"
class="ant-spin ant-spin-spinning"
style="height: 100%; display: flex; justify-content: center; align-items: center;"
>
<span
class="ant-spin-dot ant-spin-dot-spin"

View File

@ -28,6 +28,7 @@ export interface DrawerToken extends FullToken<'Drawer'> {}
// =============================== Base ===============================
const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
const {
antCls,
borderRadiusSM,
componentCls,
zIndexPopup,
@ -147,6 +148,13 @@ const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
overflow: 'auto',
background: colorBgElevated,
pointerEvents: 'auto',
[`${antCls}-spin`]: {
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
},
// Header