Ghost/ghost/admin/app/components/settings/members/archive-tier.js
Hannah Wolfe affe6743e5 Renamed products to tiers (#2372)
refs: https://github.com/TryGhost/Team/issues/1145

- this should allow us to remove the /products endpoint in v5

It avoids:

- `kg-product-card`, that really is meant to say product
- `product-cadence` on offers

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2022-05-11 22:41:54 +05:30

43 lines
1.1 KiB
JavaScript

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 {tier} = this.args;
return !!tier.active;
}
get tier() {
return this.args.tier;
}
@action
handleArchiveTier() {
if (!this.tier.isNew) {
this.modals.open('modals/tiers/archive', {
tier: this.tier,
onArchive: this.args.onArchive
}, {
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
});
}
}
@action
handleUnarchiveTier() {
if (!this.tier.isNew) {
this.modals.open('modals/tiers/unarchive', {
tier: this.tier,
onUnarchive: this.args.onUnarchive
}, {
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
});
}
}
}