| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Dropdown, Menu } from 'antd' |
| | | import { Dropdown, Menu } from 'antd' |
| | | import { FullscreenOutlined, FullscreenExitOutlined, FontSizeOutlined } from '@ant-design/icons' |
| | | |
| | | import {UnControlled as CodeMirror} from 'react-codemirror2' |
| | | import 'codemirror/mode/javascript/javascript' |
| | |
| | | |
| | | return ( |
| | | <div className="code-mirror-wrap" style={fullScreen ? style : null}> |
| | | {!fullScreen ? <Icon type="fullscreen" onClick={this.fullScreenChange}/> : null} |
| | | {fullScreen ? <Icon type="fullscreen-exit" onClick={this.fullScreenChange}/> : null} |
| | | {!fullScreen ? <FullscreenOutlined onClick={this.fullScreenChange}/> : null} |
| | | {fullScreen ? <FullscreenExitOutlined onClick={this.fullScreenChange}/> : null} |
| | | {fullScreen ? <Dropdown overlay={menu} placement="bottomRight"> |
| | | <Icon type="font-size" /> |
| | | <FontSizeOutlined /> |
| | | </Dropdown> : null} |
| | | {display ? <CodeMirror |
| | | className="code-mirror-area" |