Hi Flarum Devs,
I really need your help for a customization I want to implement...
I have made progress by developing a custom extension that adds elements inside the list array of the .Post-header class;
import app from 'flarum/app';
import { extend } from 'flarum/extend';
import CommentPost from 'flarum/components/CommentPost';
import PostControls from './PostControls';
app.initializers.add('custompostcontrols', () => {
extend(CommentPost.prototype, 'headerItems', function(items) {
items.add('postcontrols', PostControls.component());
view() {
const controls = PostControls.controls(this.props.post, this).toArray();
return (
<li>
{controls.length ? (
<Dropdown
className="Post-controls"
buttonClassName="Button Button--icon Button--flat"
menuClassName="Dropdown-menu--right"
icon="fas fa-ellipsis-h"
onshow={() => this.$('.Post-actions').addClass('open')}
onhide={() => this.$('.Post-actions').removeClass('open')}
>
{controls}
</Dropdown>
) : (
''
)}
</li>
);
}
}
But, this custom extension breaks with the controls
const in PostControls.JS, and when I remove it, I get the desired output without the list of PostControls, which is as well useless.
Please, How can I move and make the PostControls still work?