From b76e55754ff054d0b2610a0afc6cac2a9b1b3b0e Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <hello@tefkah.com>
Date: Mon, 18 Oct 2021 01:35:01 +0200
Subject: fix: delete tag from preview pane (#123)

---
 components/TagMenu.tsx | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

(limited to 'components/TagMenu.tsx')

diff --git a/components/TagMenu.tsx b/components/TagMenu.tsx
index 432e9a2..2a72e67 100644
--- a/components/TagMenu.tsx
+++ b/components/TagMenu.tsx
@@ -51,6 +51,28 @@ export const TagMenu = (props: TagMenuProps) => {
       </MenuItem>
       <Collapse in={colors.isOpen}>
         <Flex ml={2} mt={2} flexWrap="wrap">
+          <Box key="empty">
+            <Box
+              tabIndex={0}
+              cursor="pointer"
+              onClick={() =>
+                setTagColors((curr: { [tag: string]: string }) =>
+                  Object.fromEntries(
+                    Object.keys(curr)
+                      .filter((t) => t !== target)
+                      .map((t) => [t, curr[t]]),
+                  ),
+                )
+              }
+              bgColor={''}
+              m={1}
+              borderRadius="sm"
+              borderColor="gray.600"
+              borderWidth={1}
+              height={3}
+              width={3}
+            ></Box>
+          </Box>
           {colorList.map((color: string) => (
             <Box key={color}>
               <Box
-- 
cgit v1.2.3

