From 41814aa14040aa038c17ee0728532b0e341c5953 Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 31 Dec 2024 00:49:03 -0500 Subject: Refactor BMIcon --- extension/src/components/BMEditor.tsx | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'extension/src/components/BMEditor.tsx') diff --git a/extension/src/components/BMEditor.tsx b/extension/src/components/BMEditor.tsx index 2579bdb..4ebdaa2 100644 --- a/extension/src/components/BMEditor.tsx +++ b/extension/src/components/BMEditor.tsx @@ -2,17 +2,25 @@ import React, {useContext, useEffect, useState} from "react"; import CloseIcon from "../assets/close.svg?react" import {ActiveEdit} from "./Body.tsx"; import {getBrowser} from "../main.tsx"; +import RadioButtonGroup from "./RadioButtonGroup.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]); + setIconOptions(r["icon-aval-" + activeEdit.id]); }); }, [activeEdit]); @@ -39,13 +47,21 @@ function BMEditor() { )}

Icon

- {/**/} - {iconOptions && iconOptions.map(s => - // - )} - {/**/} +

Found on the site

+ {/*{ iconOptions &&*/} + {/* {*/} + {/* return { props: {*/} + {/* value: s,*/} + {/* children: ()*/} + {/* }}*/} + {/* }*/} + {/* )}*/} + {/*/>}*/} +

From Google

+ +

Custom

+

TODO

)} ); -- cgit v1.2.3