From 9490a3a616f526ee7b495abab27af111df16bbb4 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Tue, 5 Mar 2024 15:14:38 +0000
Subject: extension: Allow deleting and opening newly saved bookmarks

---
 packages/browser-extension/src/main.tsx | 40 ++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 18 deletions(-)

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

diff --git a/packages/browser-extension/src/main.tsx b/packages/browser-extension/src/main.tsx
index 3e269982..cebbde34 100644
--- a/packages/browser-extension/src/main.tsx
+++ b/packages/browser-extension/src/main.tsx
@@ -1,32 +1,36 @@
 import React from "react";
 import ReactDOM from "react-dom/client";
-import App from "./App.tsx";
 import "./index.css";
-import { createHashRouter, RouterProvider } from "react-router-dom";
 import OptionsPage from "./OptionsPage.tsx";
 import NotConfiguredPage from "./NotConfiguredPage.tsx";
 import { Providers } from "./utils/providers.tsx";
-
-const router = createHashRouter([
-  {
-    path: "/",
-    element: <App />,
-  },
-  {
-    path: "/notconfigured",
-    element: <NotConfiguredPage />,
-  },
-  {
-    path: "/options",
-    element: <OptionsPage />,
-  },
-]);
+import BookmarkSavedPage from "./BookmarkSavedPage.tsx";
+import { HashRouter, Routes, Route } from "react-router-dom";
+import Layout from "./Layout.tsx";
+import SavePage from "./SavePage.tsx";
+import BookmarkDeletedPage from "./BookmarkDeletedPage.tsx";
 
 ReactDOM.createRoot(document.getElementById("root")!).render(
   <React.StrictMode>
     <div className="w-96 p-4">
       <Providers>
-        <RouterProvider router={router} />
+        <HashRouter>
+          <Routes>
+            <Route element={<Layout />}>
+              <Route path="/" element={<SavePage />} />
+              <Route
+                path="/bookmark/:bookmarkId"
+                element={<BookmarkSavedPage />}
+              />
+              <Route
+                path="/bookmarkdeleted"
+                element={<BookmarkDeletedPage />}
+              />
+            </Route>
+            <Route path="/notconfigured" element={<NotConfiguredPage />} />
+            <Route path="/options" element={<OptionsPage />} />
+          </Routes>
+        </HashRouter>
       </Providers>
     </div>
   </React.StrictMode>,
-- 
cgit v1.2.3-70-g09d2

