-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add editor * add defined types * add typescript * ran prettier * removed booleans
- Loading branch information
1 parent
26adcda
commit 76bf8e2
Showing
17 changed files
with
5,996 additions
and
5,801 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from "react"; | ||
import AceEditor from "react-ace"; | ||
|
||
// Import the languages and themes you want to use | ||
import "ace-builds/src-noconflict/mode-javascript"; | ||
import "ace-builds/src-noconflict/theme-monokai"; | ||
|
||
// Define a type for the props | ||
type CodeEditorProps = { | ||
value: string; | ||
onChange: (newValue: string) => void; | ||
}; | ||
|
||
const CodeEditor: React.FC<CodeEditorProps> = ({ value, onChange }) => { | ||
return ( | ||
<AceEditor | ||
mode="javascript" | ||
theme="monokai" | ||
value={value} | ||
onChange={onChange} | ||
name="UNIQUE_ID_OF_DIV" | ||
editorProps={{ $blockScrolling: true }} | ||
fontSize={14} | ||
showPrintMargin | ||
showGutter | ||
highlightActiveLine | ||
setOptions={{ | ||
enableBasicAutocompletion: true, | ||
enableLiveAutocompletion: true, | ||
enableSnippets: true, | ||
showLineNumbers: true, | ||
tabSize: 2, | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default CodeEditor; |
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
Oops, something went wrong.