From 4715a76d220fdf56f793eddb0de216154e1d84bf Mon Sep 17 00:00:00 2001 From: n-ryu Date: Thu, 8 Dec 2022 19:29:44 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20TodoBlock=EA=B3=BC=20Vertex=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=EC=8B=9C=20=ED=8E=B8=EC=A7=91=EC=9A=A9=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/diagram/PopUp.tsx | 47 +++++++++++++++++ client/src/components/diagram/TodoBlock.tsx | 14 ++++- client/src/components/diagram/TodoVertex.tsx | 15 +++++- client/src/container/diagram/Diagram.tsx | 55 ++++++++++++++++++-- 4 files changed, 123 insertions(+), 8 deletions(-) create mode 100644 client/src/components/diagram/PopUp.tsx diff --git a/client/src/components/diagram/PopUp.tsx b/client/src/components/diagram/PopUp.tsx new file mode 100644 index 0000000..1ca42c4 --- /dev/null +++ b/client/src/components/diagram/PopUp.tsx @@ -0,0 +1,47 @@ +import { ReactElement } from 'react'; +import Button from '@components/Button'; +import Update from '@images/Update.svg'; +import Delete from '@images/Delete.svg'; +import styled from 'styled-components'; +import { PRIMARY_COLORS } from '@util/Constants'; + +const { lightGray } = PRIMARY_COLORS; + +const Wrapper = styled.div` + position: fixed; + width: max-content; + display: flex; + padding: 5px; + border-radius: 10px; + background-color: ${lightGray}; + filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25)); + transform: translate(var(--x), var(--y)); +`; + +const PopUp = ({ type, x, y }: { type: 'Todo' | 'Vertex' | 'None'; x: number; y: number }): ReactElement => { + const style = { '--x': `${x}px`, '--y': `${y}px` }; + return ( + <> + {type !== 'None' && ( + + {type === 'Todo' && ( +