From 223b8a2444c973aca05bec359dd3a87d61c03387 Mon Sep 17 00:00:00 2001 From: Wang Sijie Date: Thu, 10 Mar 2022 14:47:32 +0800 Subject: [PATCH] feat(console): connector config (#358) * feat(console): connector config * fix(console): page layout issues * feat(console): saved toast * fix: style lint Co-authored-by: Charles Zhao --- .../components/CodeEditor/index.module.scss | 9 +++ .../src/components/CodeEditor/index.tsx | 23 ++++++ .../src/components/TabNav/index.module.scss | 2 +- .../pages/ConnectorDetails/index.module.scss | 12 +++ .../src/pages/ConnectorDetails/index.tsx | 74 ++++++++++++++++++- .../src/pages/Connectors/index.module.scss | 2 + .../middleware/koa-connector-error-handle.ts | 2 +- packages/phrases/src/locales/en.ts | 5 ++ packages/phrases/src/locales/zh-cn.ts | 5 ++ 9 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 packages/console/src/components/CodeEditor/index.module.scss create mode 100644 packages/console/src/components/CodeEditor/index.tsx diff --git a/packages/console/src/components/CodeEditor/index.module.scss b/packages/console/src/components/CodeEditor/index.module.scss new file mode 100644 index 000000000..f7a0e2ea0 --- /dev/null +++ b/packages/console/src/components/CodeEditor/index.module.scss @@ -0,0 +1,9 @@ +@use '@/scss/underscore' as _; + +.editor { + margin: _.unit(1) 0; + + textarea { + width: 100%; + } +} diff --git a/packages/console/src/components/CodeEditor/index.tsx b/packages/console/src/components/CodeEditor/index.tsx new file mode 100644 index 000000000..865512a84 --- /dev/null +++ b/packages/console/src/components/CodeEditor/index.tsx @@ -0,0 +1,23 @@ +import React, { ChangeEventHandler } from 'react'; + +import * as styles from './index.module.scss'; + +// Will be implemented in LOG-1708, defined 2 basic props for now. +type Props = { + value?: string; + onChange?: (value: string) => void; +}; + +const CodeEditor = ({ value, onChange }: Props) => { + const handleChange: ChangeEventHandler = (event) => { + onChange?.(event.target.value); + }; + + return ( +
+