MCPcopy Create free account
hub / github.com/chhoumann/quickadd / renderPackages

Method renderPackages

src/quickAddSettingsTab.ts:397–420  ·  view source on GitHub ↗
(setting: Setting)

Source from the content-addressed store, hash-verified

395 }
396
397 private renderPackages(setting: Setting): void {
398 // Both package actions are secondary utilities — not the page's primary
399 // action ("New choice" is) — so neither is a CTA. Keeping only one filled
400 // primary button in the view avoids competing purple CTAs (per the
401 // one-primary-button-per-page rule).
402 setting.addButton((button) =>
403 button
404 .setButtonText("Export package…")
405 .onClick(() => {
406 const choicesSnapshot = settingsStore.getState().choices;
407 new ExportPackageModal(
408 this.app,
409 this.plugin,
410 choicesSnapshot,
411 ).open();
412 }),
413 );
414
415 setting.addButton((button) =>
416 button.setButtonText("Import package…").onClick(() => {
417 new ImportPackageModal(this.app).open();
418 }),
419 );
420 }
421
422 private renderDateAliases(setting: Setting): void {
423 setting.settingEl.addClass("qa-date-alias-setting");

Callers 1

Calls 4

addButtonMethod · 0.45
onClickMethod · 0.45
setButtonTextMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected