Ghost/ghost/admin/app/components/custom-theme-settings/text.js
Kevin Ansfield 0b267098ea Added support for text custom theme settings
refs https://github.com/TryGhost/Team/issues/1109

- added basic `<CustomThemeSettings::Text>`  component that is displayed for any custom theme settings with the type `'text'`
2021-10-14 15:40:22 +01:00

20 lines
516 B
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
import {camelize} from '@ember/string';
import {guidFor} from '@ember/object/internals';
export default class CustomThemeSettingsTextComponent extends Component {
inputId = `input-${guidFor(this)}`;
inputName = camelize(this.args.setting.key);
@action
updateValue(event) {
this.args.setting.set('value', event.target.value);
}
@action
triggerOnChange() {
this.args.onChange?.();
}
}