From 688006ed8ef24378d9033879fab12621db551e5a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 5 Jul 2018 12:41:05 +0300 Subject: Do not show empty tags --- vnext/src/components/Message.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'vnext/src/components') diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js index 273e035c..509cae42 100644 --- a/vnext/src/components/Message.js +++ b/vnext/src/components/Message.js @@ -20,16 +20,14 @@ export default function Message({ data, visitor, children, ...rest }) {
- +
-
- -
+

= 0) }}>

@@ -49,7 +47,7 @@ export default function Message({ data, visitor, children, ...rest }) {  Recommend ) : visitor.uid > 0 ? ( - + {data.likes > 0 && (` ${data.likes}`)} @@ -67,7 +65,7 @@ export default function Message({ data, visitor, children, ...rest }) { )} {!Boolean(data.ReadOnly) | (visitor.uid === data.user.uid) && ( - + {data.replies > 0 && @@ -90,15 +88,21 @@ export default function Message({ data, visitor, children, ...rest }) { Открыть доступ )} - { children } + {children}
); } -function Tags({ data, user, ...rest}) { - return data && data.map(tag => { - return ({tag}) - }) +function Tags({ data, user, ...rest }) { + return data.length > 0 && ( +
+ { + data.map(tag => { + return ({tag}) + }) + } +
+ ); } Message.propTypes = { -- cgit v1.2.3