mirror of
https://github.com/flarum/core.git
synced 2025-07-26 03:01:22 +02:00
Update for Mithril 2 - Please note that PostQuoteButton and AutocompleteDropdown are not Fragments, not Components. Accordingly, they have been moved to the components folder. Co-authored-by: Matthew Kilgore <tankerkiller125@gmail.com> Co-authored-by: Franz Liedke <franz@develophp.org>
21 lines
602 B
JavaScript
21 lines
602 B
JavaScript
import { extend } from 'flarum/extend';
|
|
import Button from 'flarum/components/Button';
|
|
import CommentPost from 'flarum/components/CommentPost';
|
|
|
|
import reply from './utils/reply';
|
|
|
|
export default function () {
|
|
extend(CommentPost.prototype, 'actionItems', function (items) {
|
|
|
|
const post = this.attrs.post;
|
|
|
|
if (post.isHidden() || (app.session.user && !post.discussion().canReply())) return;
|
|
|
|
items.add('reply',
|
|
<Button className='Button Button--link' onclick={() => reply(post)}>
|
|
{app.translator.trans('flarum-mentions.forum.post.reply_link')}
|
|
</Button>
|
|
);
|
|
});
|
|
}
|