瀏覽代碼

remove unused styling

AykutSarac 3 年之前
父節點
當前提交
e9c9990631
共有 1 個文件被更改,包括 10 次插入12 次删除
  1. 10 12
      src/containers/JsonEditor/index.tsx

+ 10 - 12
src/containers/JsonEditor/index.tsx

@@ -16,10 +16,6 @@ type JsonData = {
 const StyledJSONInput = styled(JSONInput)`
 const StyledJSONInput = styled(JSONInput)`
   margin-top: 10px;
   margin-top: 10px;
   padding: 5px;
   padding: 5px;
-
-  [name="outer-box"] > div {
-    transform: translate(-75%, 25%);
-  }
 `;
 `;
 
 
 export const defaultValue = [
 export const defaultValue = [
@@ -69,17 +65,19 @@ export const JsonEditor: React.FC = () => {
     }
     }
   }, []);
   }, []);
 
 
+  const handleChange = (data: JsonData) => {
+    try {
+      JSON.parse(data.json);
+      setJson(data.json);
+    } catch (error: any) {
+      console.error("Invalid JSON!", error.stack);
+    }
+  };
+
   return (
   return (
     <StyledJSONInput
     <StyledJSONInput
       placeholder={JSON.parse(json)}
       placeholder={JSON.parse(json)}
-      onChange={(value: JsonData) => {
-        try {
-          JSON.parse(value.json);
-          setJson(value.json);
-        } catch (error: any) {
-          console.error("Invalid JSON!", error.stack);
-        }
-      }}
+      onChange={handleChange}
       locale={locale}
       locale={locale}
       height="100%"
       height="100%"
     />
     />