Ghost/ghost/admin/app/components/gh-font-selector.js
Kevin Ansfield cbb353f34d Switched newsletter body/title font selectors to dropdowns
refs https://github.com/TryGhost/Team/issues/755

- added new `<GhFontSelector>` component that wraps PowerSelect to create a quick option for offering a serif/sans-serif dropdown
- replaced radio buttons in labs email customisation modal with the new font selector
2021-06-07 18:52:37 +01:00

26 lines
679 B
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
export default class GhFontSelector extends Component {
get options() {
return [{
name: 'Elegant serif',
description: 'All site visitors to your site, no login required',
value: 'serif'
}, {
name: 'Clean sans-serif',
description: 'A more minimal style with sharp lines',
value: 'sans_serif'
}];
}
get selectedOption() {
return this.options.find(o => o.value === this.args.selected);
}
@action
selectOption(option) {
this.args.onChange(option.value);
}
}