From 8751ba26ebf7b7761b9e237f2bf3453623dd1018 Mon Sep 17 00:00:00 2001
From: polwex <polwex@sortug.com>
Date: Mon, 6 Oct 2025 10:13:39 +0700
Subject: added frontend WS connection for demonstration purposes

---
 gui/src/App.tsx | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 gui/src/App.tsx

(limited to 'gui/src/App.tsx')

diff --git a/gui/src/App.tsx b/gui/src/App.tsx
new file mode 100644
index 0000000..415cb66
--- /dev/null
+++ b/gui/src/App.tsx
@@ -0,0 +1,46 @@
+import { useEffect, useState } from "react";
+import useLocalState from "@/state/state";
+import Router from "./Router";
+import "@/styles/styles.css";
+import { ThemeProvider } from "@/styles/ThemeProvider";
+import spinner from "@/assets/crowspinner.gif";
+
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { Toaster } from "react-hot-toast";
+const queryClient = new QueryClient();
+
+// const isMobile = MOBILE_BROWSER_REGEX.test(navigator.userAgent);
+
+function App() {
+  const [loading, setLoading] = useState(true);
+  console.log("NOSTRILL INIT");
+  const { init, modal } = useLocalState((s) => ({
+    init: s.init,
+    modal: s.modal,
+  }));
+  useEffect(() => {
+    init().then((_res: any) => {
+      setLoading(false);
+    });
+  }, []);
+  if (loading)
+    return (
+      <div className="global-center">
+        <img id="global-spinner" src={spinner} alt="" />
+        <h3 style={{ textAlign: "center" }}>Syncing with your Urbit...</h3>
+      </div>
+    );
+  else
+    return (
+      <ThemeProvider>
+        <QueryClientProvider client={queryClient}>
+          {/* {isMobile ? <MobileUI /> : <DesktopUI />} */}
+          <Router />
+          {modal && modal}
+          <Toaster position="top-center" />
+        </QueryClientProvider>
+      </ThemeProvider>
+    );
+}
+
+export default App;
-- 
cgit v1.2.3

