diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2025-01-18 15:16:12 -0500 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2025-01-18 15:16:12 -0500 |
commit | 279e8c7ea4f7e48ee68844e4347a67e5875faaa2 (patch) | |
tree | 518b4c7dd2c5b1c626645ba17423e788c0ef426a /extension/src/components/BMEditor.tsx | |
parent | ef013458cc29c6948603e32a001019fe6c52b743 (diff) | |
download | bookmarks-home-279e8c7ea4f7e48ee68844e4347a67e5875faaa2.tar.gz bookmarks-home-279e8c7ea4f7e48ee68844e4347a67e5875faaa2.tar.bz2 bookmarks-home-279e8c7ea4f7e48ee68844e4347a67e5875faaa2.zip |
Icon picker working (barely, refresh after)
Diffstat (limited to 'extension/src/components/BMEditor.tsx')
-rw-r--r-- | extension/src/components/BMEditor.tsx | 33 |
1 files changed, 5 insertions, 28 deletions
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<string[]>([]); - const [gIcon, setGIcon] = useState<string | undefined>(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() { </>)} <h3>Icon</h3> - <h4>Found on the site</h4> - <div className={"icon-selector"}> - { iconOptions && - // <RadioButtonGroup value={undefined} children={ - iconOptions.map(s => - <BMIcon imgSrc={s}/> - ) - // /> - } - </div> - <h4>From Google</h4> - <div className={"icon-selector"}> - <BMIcon imgSrc={gIcon}/> - </div> - <h4>Custom</h4> - <button className={"default"}>Upload</button> + <IconPicker bmData={activeEdit}/> + </>)} </div> ); |