style: drawer styles
This commit is contained in:
@@ -2,7 +2,7 @@ import { createFromIconfontCN } from '@ant-design/icons';
|
|||||||
// import './iconfont/iconfont.js';
|
// import './iconfont/iconfont.js';
|
||||||
|
|
||||||
const IconFont = createFromIconfontCN({
|
const IconFont = createFromIconfontCN({
|
||||||
scriptUrl: '//at.alicdn.com/t/c/font_4613488_5idsv7urmzf.js'
|
scriptUrl: '//at.alicdn.com/t/c/font_4613488_xvmo08q7urm.js'
|
||||||
});
|
});
|
||||||
|
|
||||||
export default IconFont;
|
export default IconFont;
|
||||||
|
|||||||
@@ -2,8 +2,20 @@ import { useEscHint } from '@/hooks/use-esc-hint';
|
|||||||
import { CloseOutlined } from '@ant-design/icons';
|
import { CloseOutlined } from '@ant-design/icons';
|
||||||
import { Button, Drawer, type DrawerProps } from 'antd';
|
import { Button, Drawer, type DrawerProps } from 'antd';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* use ColumnWrapper to wrap content in Drawer with scroller
|
||||||
|
* 57px is the height of header
|
||||||
|
* @param props
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
const ScrollerModal = (props: DrawerProps) => {
|
const ScrollerModal = (props: DrawerProps) => {
|
||||||
const { title, closable = true, maskClosable = false, ...restProps } = props;
|
const {
|
||||||
|
title,
|
||||||
|
closable = true,
|
||||||
|
maskClosable = false,
|
||||||
|
styles,
|
||||||
|
...restProps
|
||||||
|
} = props;
|
||||||
const { EscHint } = useEscHint({
|
const { EscHint } = useEscHint({
|
||||||
enabled: !props.keyboard && props.open
|
enabled: !props.keyboard && props.open
|
||||||
});
|
});
|
||||||
@@ -14,6 +26,19 @@ const ScrollerModal = (props: DrawerProps) => {
|
|||||||
<>
|
<>
|
||||||
<Drawer
|
<Drawer
|
||||||
{...restProps}
|
{...restProps}
|
||||||
|
styles={{
|
||||||
|
body: {
|
||||||
|
height: 'calc(100vh - 57px)',
|
||||||
|
paddingBlock: 16,
|
||||||
|
paddingInline: 0,
|
||||||
|
overflowX: 'hidden',
|
||||||
|
...styles?.body
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
borderRadius: '6px 0 0 6px',
|
||||||
|
...styles?.content
|
||||||
|
}
|
||||||
|
}}
|
||||||
closable={false}
|
closable={false}
|
||||||
maskClosable={maskClosable}
|
maskClosable={maskClosable}
|
||||||
title={
|
title={
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ export default {
|
|||||||
inputFontSizeLG: 14
|
inputFontSizeLG: 14
|
||||||
},
|
},
|
||||||
Steps: {
|
Steps: {
|
||||||
descriptionMaxWidth: 200
|
descriptionMaxWidth: 200,
|
||||||
|
iconSizeSM: 20
|
||||||
},
|
},
|
||||||
Table: {
|
Table: {
|
||||||
headerBorderRadius: 4,
|
headerBorderRadius: 4,
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ export default {
|
|||||||
inputFontSizeLG: 14
|
inputFontSizeLG: 14
|
||||||
},
|
},
|
||||||
Steps: {
|
Steps: {
|
||||||
descriptionMaxWidth: 200
|
descriptionMaxWidth: 200,
|
||||||
|
iconSizeSM: 20
|
||||||
},
|
},
|
||||||
Table: {
|
Table: {
|
||||||
headerBorderRadius: 4,
|
headerBorderRadius: 4,
|
||||||
|
|||||||
@@ -82,7 +82,9 @@ export default function useOverlayScroller(data?: {
|
|||||||
...scrollbars,
|
...scrollbars,
|
||||||
theme:
|
theme:
|
||||||
scrollbars?.theme ||
|
scrollbars?.theme ||
|
||||||
(userSettings.theme === 'light' ? 'os-theme-dark' : 'os-theme-light')
|
(userSettings.theme === 'light' || !userSettings.theme
|
||||||
|
? 'os-theme-dark'
|
||||||
|
: 'os-theme-light')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
|
|||||||
@@ -204,16 +204,6 @@ const AddModal: React.FC<AddModalProps> = ({
|
|||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
styles={{
|
|
||||||
body: {
|
|
||||||
height: 'calc(100vh - 57px)',
|
|
||||||
padding: '16px 0',
|
|
||||||
overflowX: 'hidden'
|
|
||||||
},
|
|
||||||
content: {
|
|
||||||
borderRadius: '6px 0 0 6px'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
width={600}
|
width={600}
|
||||||
footer={false}
|
footer={false}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -330,16 +330,6 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
styles={{
|
|
||||||
body: {
|
|
||||||
height: 'calc(100vh - 57px)',
|
|
||||||
padding: '16px 0',
|
|
||||||
overflowX: 'hidden'
|
|
||||||
},
|
|
||||||
content: {
|
|
||||||
borderRadius: '6px 0 0 6px'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
width={width}
|
width={width}
|
||||||
footer={false}
|
footer={false}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -536,16 +536,6 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
closeIcon={false}
|
closeIcon={false}
|
||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
styles={{
|
|
||||||
body: {
|
|
||||||
height: 'calc(100vh - 57px)',
|
|
||||||
padding: '16px 0',
|
|
||||||
overflowX: 'hidden'
|
|
||||||
},
|
|
||||||
content: {
|
|
||||||
borderRadius: '6px 0 0 6px'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
width={width}
|
width={width}
|
||||||
footer={false}
|
footer={false}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -244,16 +244,6 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
width={600}
|
width={600}
|
||||||
styles={{
|
|
||||||
body: {
|
|
||||||
height: 'calc(100vh - 57px)',
|
|
||||||
padding: '16px 0',
|
|
||||||
overflowX: 'hidden'
|
|
||||||
},
|
|
||||||
content: {
|
|
||||||
borderRadius: '6px 0 0 6px'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
footer={false}
|
footer={false}
|
||||||
>
|
>
|
||||||
<ColumnWrapper
|
<ColumnWrapper
|
||||||
|
|||||||
@@ -165,16 +165,6 @@ const DownloadModel: React.FC<AddModalProps> = (props) => {
|
|||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
keyboard={false}
|
keyboard={false}
|
||||||
zIndex={2000}
|
zIndex={2000}
|
||||||
styles={{
|
|
||||||
body: {
|
|
||||||
height: 'calc(100vh - 57px)',
|
|
||||||
padding: '16px 0',
|
|
||||||
overflowX: 'hidden'
|
|
||||||
},
|
|
||||||
content: {
|
|
||||||
borderRadius: '6px 0 0 6px'
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
width={width}
|
width={width}
|
||||||
footer={false}
|
footer={false}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user