Ghost/ghost/admin/app/components/settings/form-fields/publication-logo.js
Rishabh Garg 6c131de6eb
Added image editing feature for publication logo and cover (#16741)
refs https://github.com/TryGhost/Team/issues/3145

- adds image editing functionality(behind flag) using pintura
integration to publication logo and cover
2023-05-05 16:30:34 +05:30

33 lines
738 B
JavaScript

import Component from '@glimmer/component';
import {
IMAGE_EXTENSIONS,
IMAGE_MIME_TYPES
} from 'ghost-admin/components/gh-image-uploader';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
export default class PublicationLogoFormField extends Component {
@service settings;
imageExtensions = IMAGE_EXTENSIONS;
imageMimeTypes = IMAGE_MIME_TYPES;
@action
imageUploaded(results) {
if (results[0]) {
this.update(results[0].url);
}
}
@action
saveImage(setFiles, imageFile) {
setFiles([imageFile]);
}
@action
update(value) {
this.settings.logo = value;
this.args.didUpdate('logo', value);
}
}