From cb5240d00c19cb6c2266438fb7974c98c4d52bc4 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Tue, 25 Jun 2019 13:08:31 +0300
Subject: Thread: hide empty replies block
---
vnext/src/ui/Thread.js | 62 ++++++++++++++++++++++++++------------------------
1 file changed, 32 insertions(+), 30 deletions(-)
(limited to 'vnext/src/ui/Thread.js')
diff --git a/vnext/src/ui/Thread.js b/vnext/src/ui/Thread.js
index 734e5698..f965e80c 100644
--- a/vnext/src/ui/Thread.js
+++ b/vnext/src/ui/Thread.js
@@ -79,25 +79,25 @@ function Comment({ msg, draft, visitor, active, setActive, onStartEditing, postC
active === msg.rid && Write a comment...
}
- {
- visitor.uid > 0 ? (
- <>
- {active === msg.rid || setActive(msg.rid)}>Reply}
- {
- visitor.uid == msg.user.uid &&
- <>
- ·
- onStartEditing(msg)}>Edit
- >
- }
- >
- ) : (
+ {
+ visitor.uid > 0 ? (
+ <>
+ {active === msg.rid || setActive(msg.rid)}>Reply}
+ {
+ visitor.uid == msg.user.uid &&
<>
- · {active === msg.rid || }
+ ·
+ onStartEditing(msg)}>Edit
>
- )
- }
-
+ }
+ >
+ ) : (
+ <>
+ · {active === msg.rid || }
+ >
+ )
+ }
+
);
}
@@ -192,19 +192,21 @@ export default function Thread(props) {
)
}
-
- {
- !loading ? replies.map((msg) => (
- -
-
-
- )) : (
- <>
- {Array(loaders).fill().map((it, i) => )}
- >
- )
- }
-
+ {
+ message.replies &&
+ {
+ !loading ? replies.map((msg) => (
+ -
+
+
+ )) : (
+ <>
+ {Array(loaders).fill().map((it, i) => )}
+ >
+ )
+ }
+
+ }
>
);
}
--
cgit v1.2.3