diff options
author | crupest <crupest@outlook.com> | 2021-07-07 01:19:47 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-07-07 01:19:47 +0800 |
commit | cd521b4fca89bebe036b70695f3b45b0cfcc035d (patch) | |
tree | c7ebf089a323232d685dc9f03dbdee0956ea8fb3 /FrontEnd/src/views/timeline-common/TimelinePostView.tsx | |
parent | f964adac55f0a231c43a14bf583137763d911bbe (diff) | |
download | timeline-cd521b4fca89bebe036b70695f3b45b0cfcc035d.tar.gz timeline-cd521b4fca89bebe036b70695f3b45b0cfcc035d.tar.bz2 timeline-cd521b4fca89bebe036b70695f3b45b0cfcc035d.zip |
feat: Add dialog animations.
Diffstat (limited to 'FrontEnd/src/views/timeline-common/TimelinePostView.tsx')
-rw-r--r-- | FrontEnd/src/views/timeline-common/TimelinePostView.tsx | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/FrontEnd/src/views/timeline-common/TimelinePostView.tsx b/FrontEnd/src/views/timeline-common/TimelinePostView.tsx index de6c3e7c..086176f8 100644 --- a/FrontEnd/src/views/timeline-common/TimelinePostView.tsx +++ b/FrontEnd/src/views/timeline-common/TimelinePostView.tsx @@ -124,36 +124,34 @@ const TimelinePostView: React.FC<TimelinePostViewProps> = (props) => { </div> ) : null} </Card> - {dialog === "delete" ? ( - <ConfirmDialog - title="timeline.post.deleteDialog.title" - body="timeline.post.deleteDialog.prompt" - open - onClose={() => { - setDialog(null); - setOperationMaskVisible(false); - }} - onConfirm={() => { - void getHttpTimelineClient() - .deletePost(post.timelineName, post.id) - .then(onDeleted, () => { - pushAlert({ - type: "danger", - message: "timeline.deletePostFailed", - }); + <ConfirmDialog + title="timeline.post.deleteDialog.title" + body="timeline.post.deleteDialog.prompt" + open={dialog === "delete"} + onClose={() => { + setDialog(null); + setOperationMaskVisible(false); + }} + onConfirm={() => { + void getHttpTimelineClient() + .deletePost(post.timelineName, post.id) + .then(onDeleted, () => { + pushAlert({ + type: "danger", + message: "timeline.deletePostFailed", }); - }} - /> - ) : dialog === "changeproperty" ? ( - <PostPropertyChangeDialog - onClose={() => { - setDialog(null); - setOperationMaskVisible(false); - }} - post={post} - onSuccess={onChanged} - /> - ) : null} + }); + }} + /> + <PostPropertyChangeDialog + open={dialog === "changeproperty"} + onClose={() => { + setDialog(null); + setOperationMaskVisible(false); + }} + post={post} + onSuccess={onChanged} + /> </div> ); }; |