1
This commit is contained in:
parent
e86ef25e6d
commit
267afbf468
@ -95,4 +95,24 @@
|
||||
line-height: 1;
|
||||
content: '*';
|
||||
}
|
||||
|
||||
.monaco-editor {
|
||||
border-radius: 2px;
|
||||
border: 1px solid #d9d9d9;
|
||||
}
|
||||
}
|
||||
|
||||
.fullscreen-modal {
|
||||
:global {
|
||||
.ant-modal {
|
||||
max-width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
top: 0 !important;
|
||||
}
|
||||
.ant-modal-content {
|
||||
height: 100vh;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,7 @@ const CodePreviewModal: React.FC<{
|
||||
}> = ({open, onCancel, code, language = 'shell'}) => {
|
||||
const [isFullscreen, setIsFullscreen] = useState(false);
|
||||
|
||||
// 当模态框打开或关闭时重置全屏状态
|
||||
// 当模态<EFBFBD><EFBFBD>打开或关闭时重置全屏状态
|
||||
useEffect(() => {
|
||||
setIsFullscreen(false);
|
||||
}, [open]);
|
||||
@ -44,15 +44,14 @@ const CodePreviewModal: React.FC<{
|
||||
setIsFullscreen(false);
|
||||
}}
|
||||
footer={null}
|
||||
width={isFullscreen ? "100%" : 800}
|
||||
width={isFullscreen ? "100vw" : 800}
|
||||
style={isFullscreen ? {
|
||||
top: 0,
|
||||
paddingBottom: 0
|
||||
} : undefined}
|
||||
wrapClassName={isFullscreen ? 'fullscreen-modal' : undefined}
|
||||
styles={{
|
||||
body: { padding: 0 },
|
||||
content: isFullscreen ? {
|
||||
top: 0,
|
||||
maxWidth: '100%',
|
||||
margin: 0,
|
||||
paddingBottom: 0
|
||||
} : undefined
|
||||
body: { padding: 0 }
|
||||
}}
|
||||
destroyOnClose
|
||||
>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user