set theme of comments inside user-info to light

This commit is contained in:
igoradamenko
2018-12-16 21:23:08 +02:00
parent 59ed9bb9a4
commit b7f1b2a609
2 changed files with 8 additions and 4 deletions
@@ -4,12 +4,16 @@ import { h } from 'preact';
import Comment from 'components/comment';
import Preloader from 'components/preloader';
const LastCommentsList = ({ comments, isLoading }) => {
const LastCommentsList = ({ comments, isLoading, mods = {} }) => {
if (isLoading) {
return <Preloader mix="user-info__preloader" />;
}
return <div>{comments.map(comment => <Comment data={comment} mods={{ level: 0, view: 'user' }} />)}</div>;
return (
<div>
{comments.map(comment => <Comment data={comment} mods={{ level: 0, view: 'user', theme: mods.theme }} />)}
</div>
);
};
export default LastCommentsList;
+2 -2
View File
@@ -51,11 +51,11 @@ class UserInfo extends Component {
return (
<div className={b('user-info', props)}>
<Avatar mix="user-info__avatar" picture={isDefaultPicture ? null : picture} />
<Avatar mods={{ theme: 'light' }} mix="user-info__avatar" picture={isDefaultPicture ? null : picture} />
<p className="user-info__title">Last comments by {name}</p>
<p className="user-info__id">{id}</p>
{!!comments && <LastCommentsList isLoading={isLoading} comments={comments} />}
{!!comments && <LastCommentsList mods={{ theme: 'light' }} isLoading={isLoading} comments={comments} />}
</div>
);
}