From 03b7ccaa5c152c8d7ed73374be8ad4d4d034845b Mon Sep 17 00:00:00 2001
From: sowgro <tpoke.ferrari@gmail.com>
Date: Thu, 7 Nov 2024 12:40:42 -0500
Subject: Implement sorting and refactor

---
 extension/src/Body.tsx | 56 --------------------------------------------------
 1 file changed, 56 deletions(-)
 delete mode 100644 extension/src/Body.tsx

(limited to 'extension/src/Body.tsx')

diff --git a/extension/src/Body.tsx b/extension/src/Body.tsx
deleted file mode 100644
index 2a46a67..0000000
--- a/extension/src/Body.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import React, {useEffect, useState} from "react";
-import SettingsEditor from "./SettingsEditor.tsx";
-import imageUrl from "./assets/settings.svg"
-import BookmarkTreeNode = browser.bookmarks.BookmarkTreeNode;
-import FolderBody from "./FolderBody.tsx";
-import {defaultSettings, ISettings, loadSettings, writeSettings} from "./Settings.ts";
-import {getBrowser} from "./main.tsx";
-
-export const Settings =
-    React.createContext<[ISettings, (arg0: ISettings) => void]>([
-    defaultSettings,
-    () => {}
-]);
-
-function Body() {
-    const [settingsOpen, setSettingsOpen] = useState(false);
-    const [settings, setSettings] = useState<ISettings>(defaultSettings);
-    const [bookmarkTree, setBookmarkTree] = useState<BookmarkTreeNode[]>([])
-    const [ogBookmarkTree, setOgBookmarkTree] = useState<BookmarkTreeNode[] | null>([])
-    useEffect(() => {
-        loadSettings().then(r => {
-            setSettings(r);
-        })
-        getBrowser().bookmarks.getTree().then(t => {
-            setOgBookmarkTree(t);
-        })
-    }, [])
-    useEffect(() => {
-        writeSettings(settings);
-        if (settings?.rootFolder) {
-            getBrowser().bookmarks.getSubTree(settings.rootFolder).then(t => {
-                setBookmarkTree(t);
-            });
-        } else {
-            getBrowser().bookmarks.getTree().then(t => {
-                setBookmarkTree(t);
-            })
-        }
-    }, [settings]);
-
-    return (
-        <Settings.Provider value={[settings!, setSettings]}>
-            {(() => {switch (settings.backgroundMode) {
-                case "color": return (<style>{"body {background-color: " + settings.backgroundColor + "; }"}</style>)
-                case "image": return (<style>{"body {background-image: url(\"" + settings.backgroundImage + "\"); }"}</style>)
-            }})()}
-            <button id="settings-button" onClick={_ => setSettingsOpen(!settingsOpen)}>
-                <img alt="open settings" src={imageUrl}/>
-            </button>
-            <SettingsEditor tree={ogBookmarkTree!} isOpen={[settingsOpen, setSettingsOpen]}/>
-            {bookmarkTree[0] && (<FolderBody data={bookmarkTree[0]}/>)}
-        </Settings.Provider>
-    )
-}
-
-export default Body
\ No newline at end of file
-- 
cgit v1.2.3

