Skip to content

Commit

Permalink
Added Helper support to CodeEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Perez committed Oct 22, 2024
1 parent 39efcdf commit 3e413cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/CodeEditor/CodeEditor.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ export interface CodeEditorProps {
helpTools?: React.ReactNode;
sx?: OverrideTheme;
horizontal?: boolean;
helper?: string;
}
7 changes: 6 additions & 1 deletion src/components/CodeEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { FC, useMemo } from "react";
import React, { FC, useMemo } from "react";
import { css, useTheme } from "@emotion/react";
import CodeEditor from "@uiw/react-textarea-code-editor";

Expand All @@ -25,6 +25,7 @@ import InputLabel from "../InputLabel";
import Tooltip from "../Tooltip";
import { codeEditorStyles } from "./CodeEditor.styles";
import { CodeEditorProps } from "./CodeEditor.types";
import InputHelper from "../InputHelper";

const CodeMirrorWrapper: FC<CodeEditorProps> = ({
value,
Expand All @@ -37,6 +38,7 @@ const CodeMirrorWrapper: FC<CodeEditorProps> = ({
helpTools,
className,
horizontal = false,
helper
}) => {
const theme = useTheme();

Expand Down Expand Up @@ -92,6 +94,9 @@ const CodeMirrorWrapper: FC<CodeEditorProps> = ({
/>
</Box>
</Box>
{helper !== undefined && (
<InputHelper state={state}>{helper}</InputHelper>
)}
</div>
);
};
Expand Down

0 comments on commit 3e413cd

Please sign in to comment.