generated from phonetonote/ptn-logseq-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
36 lines (31 loc) · 907 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import "@logseq/libs";
import { LSPluginBaseInfo } from "@logseq/libs/dist/LSPlugin.user";
import { settingSchema } from "./setting-schema";
import { h, render } from "preact";
import PtnModal from "./components/PtnModal";
/**
* main entry
* @param baseInfo
*/
function main(baseInfo: LSPluginBaseInfo) {
render(<PtnModal />, document.getElementById("app")!);
logseq.provideModel({
openModal() {
console.log("ptn log --- open modal");
console.log("ptn log --- user settings", baseInfo?.settings);
logseq.showMainUI();
console.log("ptn log --- showed main ui");
},
});
logseq.App.registerUIItem("toolbar", {
key: "ptn-logseq-starter",
template: `
<a data-on-click="openModal"
class="button">
<i class="ti ti-wand"></i>
</a>
`,
});
logseq.useSettingsSchema(settingSchema);
}
logseq.ready(main).catch(console.error);