diff --git a/ghost/admin/app/components/settings/members/archive-tier.hbs b/ghost/admin/app/components/settings/members/archive-tier.hbs new file mode 100644 index 0000000000..48185189dc --- /dev/null +++ b/ghost/admin/app/components/settings/members/archive-tier.hbs @@ -0,0 +1,17 @@ +{{#if this.product.active}} + {{#unless this.product.isNew}} + + {{/unless}} +{{else}} + +{{/if}} \ No newline at end of file diff --git a/ghost/admin/app/components/settings/members/archive-tier.js b/ghost/admin/app/components/settings/members/archive-tier.js new file mode 100644 index 0000000000..97bc87d8f0 --- /dev/null +++ b/ghost/admin/app/components/settings/members/archive-tier.js @@ -0,0 +1,42 @@ +import Component from '@glimmer/component'; +import {action} from '@ember/object'; +import {inject as service} from '@ember/service'; + +export default class ArchiveTierComponent extends Component { + @service notifications; + @service router; + @service modals; + + get isActive() { + const {product} = this.args; + return !!product.active; + } + + get product() { + return this.args.product; + } + + @action + handleArchiveTier() { + if (!this.product.isNew) { + this.modals.open('modals/tiers/archive', { + product: this.product, + onArchive: this.args.onArchive + }, { + className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide' + }); + } + } + + @action + handleUnarchiveTier() { + if (!this.product.isNew) { + this.modals.open('modals/tiers/unarchive', { + product: this.product, + onUnarchive: this.args.onUnarchive + }, { + className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide' + }); + } + } +}