-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: TodoBlock과 Vertex 클릭 시 편집용 팝업 생성
- Loading branch information
Showing
4 changed files
with
123 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' && ( | ||
<Wrapper style={style as React.CSSProperties}> | ||
{type === 'Todo' && ( | ||
<Button | ||
context={<img src={Update} width="40px" height="40px" />} | ||
onClick={(e) => { | ||
console.log('update'); | ||
}} | ||
/> | ||
)} | ||
<Button | ||
context={<img src={Delete} width="40px" height="40px" />} | ||
onClick={(e) => { | ||
console.log('delete'); | ||
}} | ||
/> | ||
</Wrapper> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default PopUp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters