From 626b73a8593fec7d585edee77629c17e850ac439 Mon Sep 17 00:00:00 2001 From: Matheus Marabesi Date: Sun, 17 Jul 2022 18:51:19 +0200 Subject: [PATCH] chore: checkpoint splitting components --- src/App.tsx | 76 ++++++++++++++++++++++------------- src/components/Header.tsx | 10 +++++ src/components/JsonEditor.tsx | 2 +- tailwind.config.js | 1 + 4 files changed, 61 insertions(+), 28 deletions(-) create mode 100644 src/components/Header.tsx diff --git a/src/App.tsx b/src/App.tsx index 60240d9..f50ebba 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,6 +7,17 @@ import JsonMenu from "./components/JsonMenu"; const cleanUp = new CleanUp(); +function Header() { + return
+
+

JSON tool

| + by marabesi +
+ Buy + me a coffee +
; +} + function App() { const [originalJson, setOriginalResult] = useState(''); const [result, setResult] = useState(''); @@ -80,17 +91,11 @@ function App() { const updateSpacing = (newSpacing: string) => setSpacing(newSpacing); return ( -
-
-
-

JSON tool

| - by marabesi -
- Buy me a coffee -
-
+
+
+
-
+ onJsonChange(eventValue.value)} data-testid="json" /> -
-
- - - -
+ + + + + +
{error &&

{error}

}
+
+ + Footer text or link about CC + + | + + Other foot text with usual legal stuff + +
); } export default App; + +function EditorContainer({ children }: any) { + return ( +
+ {children} +
+ ); +} diff --git a/src/components/Header.tsx b/src/components/Header.tsx new file mode 100644 index 0000000..6e3fc69 --- /dev/null +++ b/src/components/Header.tsx @@ -0,0 +1,10 @@ +export default function Header() { + return
+
+

JSON tool

| + by marabesi +
+ Buy + me a coffee +
; +} diff --git a/src/components/JsonEditor.tsx b/src/components/JsonEditor.tsx index 2962f73..890b7d5 100644 --- a/src/components/JsonEditor.tsx +++ b/src/components/JsonEditor.tsx @@ -29,7 +29,7 @@ export default function JsonEditor({ input, onChange, className, ...rest }: Prop