From 6e6d2c3cbc860d0024e9631b01eeef55b47933a5 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Mon, 12 Feb 2024 20:50:12 +0000
Subject: WIP: Implement saving page functionality in browser extension

---
 packages/browser-extension/src/App.tsx | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

(limited to 'packages/browser-extension/src/App.tsx')

diff --git a/packages/browser-extension/src/App.tsx b/packages/browser-extension/src/App.tsx
index 7daedc37..21fec92f 100644
--- a/packages/browser-extension/src/App.tsx
+++ b/packages/browser-extension/src/App.tsx
@@ -1,8 +1,31 @@
+import { redirect } from "react-router-dom";
+import SavePage from "./SavePage";
+import usePluginSettings from "./settings";
+import { useNavigate } from "react-router-dom";
+
 function App() {
+  const navigate = useNavigate();
+  const [settings, _1, _2, _3, isInit] = usePluginSettings();
+
+  if (!isInit) {
+    return <div className="p-4">Loading ... </div>;
+  }
+
+  if (!settings.apiKey || !settings.address) {
+    navigate("/settings");
+    return;
+  }
+
   return (
-    <>
-      <div className="text-3xl">Test</div>
-    </>
+    <div className="flex flex-col space-y-2">
+      <SavePage settings={settings} />
+      <hr />
+      <div className="flex justify-end">
+        <button className="w-2/6" onClick={() => navigate("/settings")}>
+          Settings
+        </button>
+      </div>
+    </div>
   );
 }
 
-- 
cgit v1.2.3-70-g09d2

