Add go home links in popup menu
This commit is contained in:
parent
3590d158f5
commit
56734429a7
|
|
@ -8,8 +8,6 @@ import "assets/global.less";
|
||||||
import styles from "./popup.module.less";
|
import styles from "./popup.module.less";
|
||||||
|
|
||||||
function IndexPopup() {
|
function IndexPopup() {
|
||||||
const [data, setData] = useState("")
|
|
||||||
|
|
||||||
const [tab, setTab] = useState<string>();
|
const [tab, setTab] = useState<string>();
|
||||||
|
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
|
|
@ -21,6 +19,15 @@ function IndexPopup() {
|
||||||
chrome.runtime.openOptionsPage();
|
chrome.runtime.openOptionsPage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (value === "home") {
|
||||||
|
chrome.storage.local.get(["siteUrl"]).then((res) => {
|
||||||
|
if (res.siteUrl) {
|
||||||
|
chrome.tabs.create({ url: res.siteUrl });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setTab(value);
|
setTab(value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { IconBili, IconRead, IconSetting } from "~assets/icons";
|
import { IconBili, IconPaul, IconRead, IconSetting } from "~assets/icons";
|
||||||
import styles from "./popup.module.less";
|
import styles from "./popup.module.less";
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
|
|
@ -12,6 +12,11 @@ const items = [
|
||||||
icon: <IconBili />,
|
icon: <IconBili />,
|
||||||
value: "toy",
|
value: "toy",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "访问网站",
|
||||||
|
icon: <IconPaul />,
|
||||||
|
value: "home",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "插件设置",
|
name: "插件设置",
|
||||||
icon: <IconSetting />,
|
icon: <IconSetting />,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue