mirror of
https://github.com/flarum/core.git
synced 2025-07-17 14:51:19 +02:00
- Use JSX for templates - Docblock/comment everything - Mostly passes ESLint (still some work to do) - Lots of renaming, refactoring, etc. CSS hasn't been updated yet.
34 lines
844 B
JavaScript
34 lines
844 B
JavaScript
import Component from 'flarum/Component';
|
|
import avatar from 'flarum/helpers/avatar';
|
|
import DiscussionControls from 'flarum/utils/DiscussionControls';
|
|
|
|
/**
|
|
* The `ReplyPlaceholder` component displays a placeholder for a reply, which,
|
|
* when clicked, opens the reply composer.
|
|
*
|
|
* ### Props
|
|
*
|
|
* - `discussion`
|
|
*/
|
|
export default class ReplyPlaceholder extends Component {
|
|
view() {
|
|
function triggerClick(e) {
|
|
$(this).trigger('click');
|
|
e.preventDefault();
|
|
}
|
|
|
|
const reply = () => {
|
|
DiscussionControls.replyAction.call(this.props.discussion, true);
|
|
};
|
|
|
|
return (
|
|
<article className="post reply-post" onclick={reply} onmousedown={triggerClick}>
|
|
<header className="post-header">
|
|
{avatar(app.session.user)}
|
|
Write a Reply...
|
|
</header>
|
|
</article>
|
|
);
|
|
}
|
|
}
|