use feather icon

This commit is contained in:
fyears 2022-01-16 13:38:20 +08:00
parent 4035218706
commit a78a2a88cf
2 changed files with 16 additions and 2 deletions

View File

@ -25,6 +25,7 @@
"@microsoft/microsoft-graph-types": "^2.11.0",
"@types/chai": "^4.2.22",
"@types/chai-as-promised": "^7.1.4",
"@types/feather-icons": "^4.7.0",
"@types/jsdom": "^16.2.13",
"@types/lodash": "^4.14.178",
"@types/mime-types": "^2.1.1",
@ -61,6 +62,7 @@
"codemirror": "^5.63.1",
"crypto-browserify": "^3.12.0",
"dropbox": "^10.22.0",
"feather-icons": "^4.28.0",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"loglevel": "^1.8.0",

View File

@ -1,6 +1,7 @@
import { Modal, Notice, Plugin, Setting } from "obsidian";
import { Modal, Notice, Plugin, Setting, addIcon } from "obsidian";
import cloneDeep from "lodash/cloneDeep";
import { nanoid } from "nanoid";
import feather from "feather-icons";
import type { RemotelySavePluginSettings } from "./baseTypes";
import {
COMMAND_CALLBACK,
@ -71,6 +72,17 @@ export default class RemotelySavePlugin extends Plugin {
async onload() {
log.info(`loading plugin ${this.manifest.id}`);
const iconNameSyncWait = `${this.manifest.id}-sync-wait`;
const iconNameSyncRunning = `${this.manifest.id}-sync-running`;
addIcon(
iconNameSyncWait,
feather.icons["rotate-ccw"].toSvg({ width: 100, height: 100 })
);
addIcon(
iconNameSyncRunning,
feather.icons["refresh-ccw"].toSvg({ width: 100, height: 100 })
);
this.oauth2Info = {
verifier: "",
helperModal: undefined,
@ -292,7 +304,7 @@ export default class RemotelySavePlugin extends Plugin {
}
);
this.addRibbonIcon("switch", "Remotely Save", async () => {
this.addRibbonIcon(iconNameSyncWait, "Remotely Save", async () => {
if (this.syncStatus !== "idle") {
new Notice(
`Remotely Save already running in stage ${this.syncStatus}!`