fix: remove view code loading

This commit is contained in:
jialin
2024-07-15 16:26:58 +08:00
parent cb4c984e96
commit 0270320579
5 changed files with 17 additions and 14 deletions
@@ -2,7 +2,7 @@ import EditorWrap from '@/components/editor-wrap';
import { BulbOutlined } from '@ant-design/icons';
import Editor from '@monaco-editor/react';
import { useIntl } from '@umijs/max';
import { Button, Modal, Spin } from 'antd';
import { Button, Modal } from 'antd';
import _ from 'lodash';
import React, { useEffect, useRef, useState } from 'react';
@@ -103,6 +103,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
const handleEditorDidMount = (editor: any, monaco: any) => {
editorRef.current = editor;
setLoaded(true);
console.log('loaded====');
};
const handleOnChangeLang = (value: string) => {
@@ -146,7 +147,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
<div style={{ marginBottom: '10px' }}>
{intl.formatMessage({ id: 'playground.viewcode.info' })}
</div>
<Spin spinning={!loaded}>
<div>
<EditorWrap
copyText={codeValue}
langOptions={langOptions}
@@ -181,7 +182,9 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
>
<span>
{' '}
{intl.formatMessage({ id: 'playground.viewcode.here' })}
{intl.formatMessage({
id: 'playground.viewcode.here'
})}
</span>
</Button>
)
@@ -189,7 +192,7 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
)}
</span>
</div>
</Spin>
</div>
</Modal>
</>
);