Skip to content

Commit

Permalink
feat(ui): add custom js editor in create test screen (#465) (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandravassova authored Oct 26, 2020
1 parent fa93612 commit 7138635
Show file tree
Hide file tree
Showing 5 changed files with 421 additions and 305 deletions.
35 changes: 35 additions & 0 deletions ui/src/features/components/TestForm/JSEditor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import MonacoEditor from '@uiw/react-monacoeditor';

export default function JSEditor ({ javaScript, onInputCodeChange }) {
const options = {
selectOnLineNumbers: true,
roundedSelection: false,
readOnly: false,
cursorStyle: 'line',
automaticLayout: false,
theme: 'vs'
}
return (
<div style={{ border: '1px solid #557EFF', position: 'relative', width: '100%' }}>
<MonacoEditor
language='javascript'
value={javaScript}
options={options}
height='200px'
width='100%'
onChange={onInputCodeChange}
scrollbar={{
useShadows: false,
verticalHasArrows: false,
horizontalHasArrows: false,
vertical: 'hidden',
horizontal: 'hidden',
verticalScrollbarSize: 17,
horizontalScrollbarSize: 17,
arrowSize: 30
}}
/>
</div>
)
}
Loading

0 comments on commit 7138635

Please sign in to comment.