From 4b07846bf16bbf90a5869219ce9b521367c28506 Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Thu, 18 Mar 2021 21:59:16 +0800
Subject: feat: Delete image.

---
 .../app/views/timeline-common/MarkdownPostEdit.tsx   | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

(limited to 'FrontEnd/src/app/views/timeline-common/MarkdownPostEdit.tsx')

diff --git a/FrontEnd/src/app/views/timeline-common/MarkdownPostEdit.tsx b/FrontEnd/src/app/views/timeline-common/MarkdownPostEdit.tsx
index f4351db0..68dee848 100644
--- a/FrontEnd/src/app/views/timeline-common/MarkdownPostEdit.tsx
+++ b/FrontEnd/src/app/views/timeline-common/MarkdownPostEdit.tsx
@@ -139,12 +139,22 @@ const MarkdownPostEdit: React.FC<MarkdownPostEditProps> = ({
             tabText: "image",
             page: (
               <div className="timeline-markdown-post-edit-page">
-                {images.map((image) => (
-                  <img
+                {images.map((image, index) => (
+                  <div
                     key={image.url}
-                    src={image.url}
-                    className="timeline-markdown-post-edit-image"
-                  />
+                    className="timeline-markdown-post-edit-image-container"
+                  >
+                    <img
+                      src={image.url}
+                      className="timeline-markdown-post-edit-image"
+                    />
+                    <i
+                      className="bi-trash text-danger icon-button timeline-markdown-post-edit-image-delete-button"
+                      onClick={() => {
+                        getBuilder().deleteImage(index);
+                      }}
+                    />
+                  </div>
                 ))}
                 <Form.File
                   label={t("chooseImage")}
-- 
cgit v1.2.3

