From 8f4883ea6792e4d6eda9bef1722a83b24fdc272d Mon Sep 17 00:00:00 2001 From: Olabode Lawal-Shittabey Date: Wed, 3 Apr 2024 05:46:51 +0100 Subject: [PATCH] feat: implement oneline toggle on output key (#9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This pull request implements a oneline toggle option for output, on select the oneline option the multiple line in the output key is replaced with a `\n` string removing the literal line breaks. **Screencast** [screencast-bpconcjcammlapcogcnnelfmaeghhagj-2024.04.03-05_37_06.webm](https://github.com/babblebey/private-key-converter/assets/25631971/0bdfc397-a1b4-48d3-923a-46a003ee878d) 🔑 --- app/page.js | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/app/page.js b/app/page.js index 783ac0b..e9d8f5e 100644 --- a/app/page.js +++ b/app/page.js @@ -33,6 +33,7 @@ export default function Home() { const [copied, setCopied] = useState(false); const [loading, setLoading] = useState(false); const [error, setError] = useState(initError); + const [oneline, setOneline] = useState(false); const [inputKey, setInputKey] = useState(""); const [outputKey, setOutputKey] = useState(null); @@ -112,15 +113,30 @@ export default function Home() { <> -
+
               
- +
+ + + + setOneline(prevState => !prevState)} + /> + +
-
-
-                    {outputKey}
-                  
-
+ { oneline ? ( + + ) : ( +