From 279e8c7ea4f7e48ee68844e4347a67e5875faaa2 Mon Sep 17 00:00:00 2001 From: sowgro Date: Sat, 18 Jan 2025 15:16:12 -0500 Subject: Icon picker working (barely, refresh after) --- extension/src/components/BMEditor.tsx | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) (limited to 'extension/src/components/BMEditor.tsx') diff --git a/extension/src/components/BMEditor.tsx b/extension/src/components/BMEditor.tsx index b97d21f..eb84246 100644 --- a/extension/src/components/BMEditor.tsx +++ b/extension/src/components/BMEditor.tsx @@ -4,25 +4,16 @@ import {ActiveEdit} from "./Body.tsx"; import {getBrowser} from "../main.tsx"; import RadioButtonGroup from "./RadioButtonGroup.tsx"; import BMIcon from "./BMIcon.tsx"; +import IconPicker from "./IconPicker.tsx"; + + function BMEditor() { const [activeEdit, setActiveEdit] = useContext(ActiveEdit); - const [iconOptions, setIconOptions] = useState([]); - const [gIcon, setGIcon] = useState(undefined); - useEffect(() => { if (!activeEdit) return; - - const gURL = new URL('https://www.google.com/s2/favicons'); - gURL.searchParams.set("sz", "256"); - gURL.searchParams.set("domain_url", activeEdit.url!); - setGIcon(gURL.toString()); - - getBrowser().storage.local.get("icon-aval-"+activeEdit.id).then( r => { - setIconOptions(r["icon-aval-" + activeEdit.id]); - }); }, [activeEdit]); let isFolder = activeEdit && activeEdit.children && activeEdit.children.length > 0; @@ -48,22 +39,8 @@ function BMEditor() { )}

Icon

-

Found on the site

-
- { iconOptions && - // - - ) - // /> - } -
-

From Google

-
- -
-

Custom

- + + )} ); -- cgit v1.2.3