From e9c999063187a61e211ac025eb102b66ae9fa0a3 Mon Sep 17 00:00:00 2001 From: AykutSarac Date: Fri, 4 Feb 2022 16:51:54 +0300 Subject: [PATCH] remove unused styling --- src/containers/JsonEditor/index.tsx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/containers/JsonEditor/index.tsx b/src/containers/JsonEditor/index.tsx index 2236dc9..f7723a0 100644 --- a/src/containers/JsonEditor/index.tsx +++ b/src/containers/JsonEditor/index.tsx @@ -16,10 +16,6 @@ type JsonData = { const StyledJSONInput = styled(JSONInput)` margin-top: 10px; padding: 5px; - - [name="outer-box"] > div { - transform: translate(-75%, 25%); - } `; 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 ( { - try { - JSON.parse(value.json); - setJson(value.json); - } catch (error: any) { - console.error("Invalid JSON!", error.stack); - } - }} + onChange={handleChange} locale={locale} height="100%" />