-
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.
- Loading branch information
Showing
20 changed files
with
581 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React, { useRef, useState } from 'react'; | ||
import usePopupClose from '../../../../hooks/usePopupClose'; | ||
import styles from './style.module.css'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faEllipsisV } from '@fortawesome/free-solid-svg-icons'; | ||
import PropTypes from 'prop-types'; | ||
import { useEffect } from 'react'; | ||
|
||
const Index = ({ item }) => { | ||
const [modifyPopUp, setModifyPopUp] = useState(); //아이템의 id값이 들어옴 | ||
const modify = useRef(); | ||
const close = usePopupClose(modify); | ||
|
||
/* 영역외 클릭시 팝업창 닫기 */ | ||
useEffect(() => { | ||
setModifyPopUp(close); | ||
}, [close]); | ||
return ( | ||
<div | ||
ref={modify} | ||
className={styles.modify} | ||
onClick={() => { | ||
setModifyPopUp(item.id); | ||
}} | ||
> | ||
<FontAwesomeIcon icon={faEllipsisV} /> | ||
{modifyPopUp == item.id && ( | ||
<div className={styles.modify_box}> | ||
<ul> | ||
<li> | ||
<em>수정</em> | ||
</li> | ||
<li> | ||
<em>삭제</em> | ||
</li> | ||
</ul> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
Index.propTypes = { | ||
item: PropTypes.object, | ||
}; | ||
|
||
export default Index; |
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,5 @@ | ||
.modify{width: 30px;height: 30px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 20px; cursor: pointer; } | ||
.modify_box{width: 50px;height: 100%;background: #fff; position: absolute; top: 0; right: 0; z-index: 9999; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;} | ||
.modify_box ul{display: flex; flex-direction: column; justify-content: center; align-items: center;} | ||
.modify_box ul li{} | ||
.modify_box ul li em{font-size: 14px;} |
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
Oops, something went wrong.