diff options
author | crupest <crupest@outlook.com> | 2020-06-05 21:32:16 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-05 21:32:16 +0800 |
commit | 622eac55ae87128073c98a006fe20dc079beb2a2 (patch) | |
tree | c36c3080f68ce5fb6ed19098d83fafd013efc0be /Timeline/ClientApp/src/timeline/Timeline.tsx | |
parent | 0ea07270b008d6f11155bf131d31a2d000d6442b (diff) | |
download | timeline-622eac55ae87128073c98a006fe20dc079beb2a2.tar.gz timeline-622eac55ae87128073c98a006fe20dc079beb2a2.tar.bz2 timeline-622eac55ae87128073c98a006fe20dc079beb2a2.zip |
feat(front): Fix #73 .
Diffstat (limited to 'Timeline/ClientApp/src/timeline/Timeline.tsx')
-rw-r--r-- | Timeline/ClientApp/src/timeline/Timeline.tsx | 14 |
1 files changed, 11 insertions, 3 deletions
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}
/>
|