Toby Nope, it doesn't work.
My full code:
import { extend, override } from 'flarum/extend';
import app from 'flarum/app';
// Component imports
import CommentPost from 'flarum/components/CommentPost';
import ItemList from 'flarum/utils/ItemList';
import DiscussionRenamedPost from 'flarum/components/DiscussionRenamedPost';
import UserCard from 'flarum/components/UserCard';
import UserControls from 'flarum/utils/UserControls';
app.initializers.add('Attachments', () => {
// TODO
extend(UserCard.prototype, 'infoItems', (items) => {
//if (items.lastSeen) delete items.lastSeen;
//if (items.joined) delete items.joined;
});
override(DiscussionRenamedPost.prototype, 'icon', () => {
return "star";
});
extend(CommentPost.prototype, "headerItems", (items) => {
items.add("test", <span><i className="fa fa-star"></i> This is a test: {this.props.post.user().username()}</span>);
});
});
(If you're wondering why it's called Attachments, that's just what I'm going to implement once I figure out the extension API)