-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #345 from ashik-75/work
update code editor , base64 , Json to typescript
- Loading branch information
Showing
14 changed files
with
131 additions
and
88 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
2 changes: 1 addition & 1 deletion
2
...dation/TextareaWithValidation.module.scss → ...General/CodeEditor/CodeEditor.module.scss
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.textareaContainer { | ||
.codeeditor { | ||
position: relative; | ||
&__validator { | ||
position: absolute; | ||
|
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
File renamed without changes.
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,34 @@ | ||
import React from "react"; | ||
import Editor from "@monaco-editor/react"; | ||
import useMode from "lib/utils/hooks/useMode"; | ||
import { Form } from "antd"; | ||
import style from "./CodeEditor.module.scss"; | ||
import ValidateStatus from "./components/ValidateStatus"; | ||
import { CodeEditorProps } from "./utils/types"; | ||
|
||
const CodeEditor: React.FC<CodeEditorProps> = ({ | ||
handleCode, | ||
language, | ||
code, | ||
label, | ||
status, | ||
}) => { | ||
const { isDarkMode } = useMode(); | ||
return ( | ||
<div className={style.textareaContainer}> | ||
<Form.Item label={label}> | ||
<Editor | ||
value={code} | ||
height={"50vh"} | ||
language={language || "javascript"} | ||
onChange={handleCode} | ||
theme={isDarkMode ? "vs-dark" : "light"} | ||
/> | ||
</Form.Item> | ||
|
||
<ValidateStatus status={status || ""} /> | ||
</div> | ||
); | ||
}; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
interface CodeEditorProps { | ||
handleCode: (code: string | undefined) => void; | ||
language: string; | ||
code: string; | ||
label: string; | ||
status?: string; | ||
} | ||
|
||
export type { CodeEditorProps }; |
23 changes: 0 additions & 23 deletions
23
ui/src/components/General/TextareaWithValidation/index.tsx
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
ui/src/components/General/TextareaWithValidation/utils/types.ts
This file was deleted.
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
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