forked from getredash/redash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use AceEditor for Query Snippets (getredash#3973)
Co-Authored-By: Ran Byron <[email protected]>
- Loading branch information
1 parent
61acbd7
commit 52fefe0
Showing
6 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { forwardRef } from 'react'; | ||
import AceEditor from 'react-ace'; | ||
|
||
import './AceEditorInput.less'; | ||
|
||
function AceEditorInput(props, ref) { | ||
return ( | ||
<div className="ace-editor-input"> | ||
<AceEditor | ||
ref={ref} | ||
mode="sql" | ||
theme="textmate" | ||
height="100px" | ||
editorProps={{ $blockScrolling: Infinity }} | ||
showPrintMargin={false} | ||
{...props} | ||
/> | ||
</div> | ||
); | ||
} | ||
|
||
export default forwardRef(AceEditorInput); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.ace-editor-input { | ||
// hide ghost cursor when not focused | ||
.ace_hidden-cursors { | ||
opacity: 0; | ||
} | ||
|
||
// allow Ant Form feedback icon to hover scrollbar | ||
.ace_scrollbar { | ||
z-index: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters