From 926372d503c8522c1b1c9cdfeb6b891b7f96e08d Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Fri, 5 Jun 2020 21:32:16 +0800
Subject: feat(front): Fix #73 .

---
 Timeline/ClientApp/src/timeline/Timeline.tsx | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

(limited to 'Timeline/ClientApp/src/timeline/Timeline.tsx')

diff --git a/Timeline/ClientApp/src/timeline/Timeline.tsx b/Timeline/ClientApp/src/timeline/Timeline.tsx
index defca4c3..acc3ba0a 100644
--- a/Timeline/ClientApp/src/timeline/Timeline.tsx
+++ b/Timeline/ClientApp/src/timeline/Timeline.tsx
@@ -65,14 +65,22 @@ const Timeline: React.FC<TimelineProps> = (props) => {
                 ? avatarVersion
                 : undefined;
 
+            const toggleMore = onToggleDelete[i];
+
             return (
               <TimelineItem
                 post={post}
                 key={post.id}
                 current={length - 1 === i}
-                showDeleteButton={indexShowDeleteButton === i}
-                toggleMore={onToggleDelete[i]}
-                onDelete={onItemDelete[i]}
+                more={
+                  toggleMore
+                    ? {
+                        isOpen: indexShowDeleteButton === i,
+                        toggle: toggleMore,
+                        onDelete: onItemDelete[i],
+                      }
+                    : undefined
+                }
                 onClick={onItemClick}
                 avatarVersion={av}
               />
-- 
cgit v1.2.3

