From 1ba4a0b87e02c85a94ce59c8a56a34d4086e6d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Klabbers?= Date: Tue, 12 Nov 2019 20:25:58 +0100 Subject: [PATCH] Fix existing Post component classes being dropped --- js/src/forum/components/Post.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/src/forum/components/Post.js b/js/src/forum/components/Post.js index b3e73386f..3de246a97 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 = this.classes().join(' '); + attrs.className = this.classes(attrs.className).join(' '); return (
@@ -98,8 +98,14 @@ export default class Post extends Component { return []; } - classes() { - let classes = ['Post']; + /** + * Get the post's classes. + * + * @param string classes + * @returns {string[]} + */ + classes(existing) { + let classes = (existing || '').split(' ').concat(['Post']); if (this.loading) { classes.push('Post--loading');