1
0
mirror of https://github.com/flarum/core.git synced 2025-07-17 14:51:19 +02:00
Files
php-flarum/js/forum/src/components/ReplyPlaceholder.js
Toby Zerner ab6c03c0cc Massive JavaScript cleanup
- 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.
2015-07-15 14:01:11 +09:30

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>
);
}
}