diff --git a/js/src/forum/components/Post.js b/js/src/forum/components/Post.js index 5b410f684..b3e73386f 100644 --- a/js/src/forum/components/Post.js +++ b/js/src/forum/components/Post.js @@ -39,7 +39,7 @@ export default class Post extends Component { view() { const attrs = this.attrs(); - attrs.className = 'Post ' + (this.loading ? 'Post--loading ' : '') + (this.props.post.user() === app.session.user ? 'Post--self' : '') + (attrs.className || ''); + attrs.className = this.classes().join(' '); return (
@@ -98,6 +98,20 @@ export default class Post extends Component { return []; } + classes() { + let classes = ['Post']; + + if (this.loading) { + classes.push('Post--loading'); + } + + if (this.props.post.user() === app.session.user) { + classes.push('Post--by-actor'); + } + + return classes; + } + /** * Build an item list for the post's actions. *