From 1d5311af882fe51274160470381f6f5518beeb12 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 29 Aug 2018 17:47:52 +0300 Subject: shadow banned users from recommendations list --- vnext/src/components/Thread.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'vnext/src') diff --git a/vnext/src/components/Thread.js b/vnext/src/components/Thread.js index 23654d86..b0e73b40 100644 --- a/vnext/src/components/Thread.js +++ b/vnext/src/components/Thread.js @@ -86,7 +86,7 @@ export default class Thread extends React.Component { msg.mid ? ( {this.state.active === (msg.rid || 0) && Write a comment...} - + ) : ( @@ -170,14 +170,18 @@ Thread.propTypes = { visitor: UserType.isRequired }; -function Recommendations({src, ...rest}) { - return src.length > 0 && ( -
{`Recommended by (${src.length}): `} +function Recommendations({forMessage, ...rest}) { + const { likes, recommendations } = forMessage; + return recommendations && recommendations.length > 0 && ( +
{'Recommended by '} { - src.map(it => ( + recommendations.map(it => ( {it} )).reduce((prev, curr) => [prev, ', ', curr]) } + { + likes > recommendations.length && ( and {likes - recommendations.length} others) + }
) || null; } -- cgit v1.2.3