clarkwinkelmann I learned more in this thread, and now i try to create extension for PostUser to add new badges to user, beacause PostUser don't have the method I needi. This is my code:
import app from 'flarum/app'
import { extend } from 'flarum/extend';
import PostUser from 'flarum/components/PostUser';
import Badge from 'flarum/components/Badge';
import ItemList from 'flarum/common/helpers/ItemList';
class HighlightAuthor extends PostUser {
content(){
const badges = new ItemList();
badges.add('hidden', <Badge type="hidden" icon="fas fa-gavel" label={app.translator.trans('core.lib.badge.hidden_tooltip')} />);
return badges;
}
}
app.initializers.add('studio/fix-chat', function(){
console.log('load');
extend(HighlightAuthor.prototype,'content',function(badge){
badge.add('gavel', Badge.component({
type: 'sticky',
label: 'karman',
icon: 'fas fa-gavel'
}));
})
})
its not working, but i don't know why. I will be grateful for any help, even a little advice