Ghost/ghost/admin/app/components/settings/members-subscription-access.js
Kevin Ansfield 51536fb2ef Added icons to membership dropdown options
no issue

- add icon + icon color to the subscription access and default post access option lists
- updated templates to use icon in trigger and option display
- fixed ember-power-select styles overriding svgs in trigger
2021-05-17 09:42:44 +01:00

43 lines
1.3 KiB
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
export default class SettingsMembersSubscriptionAccess extends Component {
@service settings;
get options() {
return [{
name: 'Anyone can sign up',
description: 'All visitors will be able to subscribe and sign in',
value: 'all',
icon: 'globe',
icon_color: 'green'
}, {
name: 'Only people I invite',
description: 'People can sign in from your site but won\'t be able to sign up',
value: 'invite',
icon: 'globe',
icon_color: 'green'
}, {
name: 'Nobody',
description: 'No one will be able to subscribe or sign in',
value: 'none',
icon: 'globe',
icon_color: 'green'
}];
}
get selectedOption() {
return this.options.find(o => o.value === this.settings.get('membersSignupAccess'));
}
@action
setSignupAccess(option) {
this.settings.set('membersSignupAccess', option.value);
if (option.value === 'none') {
this.settings.set('defaultContentVisibility', 'public');
}
}
}