From c70ecdc33045c3c5d676486da84a2ee0647ab1e5 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 15 Feb 2023 20:36:46 -0800 Subject: [PATCH] Iframe response viewer --- src/App.tsx | 12 ++++++++++-- src/Editor.css | 17 ++++++++++++++--- src/Editor.tsx | 2 +- src/style.css | 10 +++++++++- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 7557da80..3fc930d2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,10 +13,13 @@ interface Response { function App() { const [responseBody, setResponseBody] = useState(null); const [url, setUrl] = useState(""); + const [loading, setLoading] = useState(false); async function sendRequest() { + setLoading(true); const body = await invoke("send_request", {url: url}) as Response; setResponseBody(body); + setLoading(false); } return ( @@ -33,7 +36,7 @@ function App() { onChange={(e) => setUrl(e.currentTarget.value)} placeholder="Enter a URL..." /> - + {responseBody !== null && ( <> @@ -44,7 +47,12 @@ function App() {  •  {responseBody?.elapsed2}ms - +
+ +
+