-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit e9f4f7e Author: heejung0413 <[email protected]> Date: Sat Apr 20 03:12:07 2024 +0900 fix: section 페이지 api 연결 commit 841bb55 Author: heejung0413 <[email protected]> Date: Sat Apr 20 00:20:27 2024 +0900 🐛Fix: 자잘한 api 수정(section 페이지 action item 추가, 따로 컴포넌트 설정) commit 40ba27f Author: heejung0413 <[email protected]> Date: Fri Apr 19 17:32:57 2024 +0900 🐛Fix: section 페이지 api 연결 commit cd40003 Author: heejung0413 <[email protected]> Date: Fri Apr 19 16:30:00 2024 +0900 긴급) fix: team type 수정
- Loading branch information
1 parent
78b0e32
commit 93589e5
Showing
19 changed files
with
197 additions
and
242 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
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React, { FC, useState } from 'react'; | ||
import { sectionData } from '@/api/@types/Section'; | ||
import UserProfile1 from '@/assets/UserProfile1.png'; | ||
import UserProfile2 from '@/assets/UserProfile2.png'; | ||
import Members from '@/components/writeRetro/ActionItems/Members'; | ||
import * as S from '@/styles/writeRetroStyles/Layout.style'; | ||
|
||
interface Props { | ||
section: sectionData[]; | ||
} | ||
|
||
const ActionItemTask: FC<Props> = ({ section }) => { | ||
// action items 담당자 지정 | ||
const [hoveredUser, setHoveredUser] = useState<string | null>(null); | ||
const [showPopup, setShowPopup] = useState<boolean>(false); | ||
const [selectedUserName, setSelectedUserName] = useState<string | null>(null); | ||
const [selectedUserImg, setSelectedUserImg] = useState<string | null>(null); | ||
|
||
const users = [ | ||
{ name: 'User 1', image: UserProfile1 }, | ||
{ name: 'User 2', image: UserProfile2 }, | ||
]; | ||
|
||
const togglePopup = () => { | ||
setShowPopup(!showPopup); | ||
}; | ||
|
||
const handleSelectUserImg = (image: string) => { | ||
setSelectedUserImg(image); | ||
setShowPopup(false); | ||
}; | ||
|
||
const handleSelectUserName = (name: string) => { | ||
setSelectedUserName(name); | ||
}; | ||
|
||
const handleMouseEnter = (name: string) => { | ||
setHoveredUser(name); | ||
}; | ||
|
||
const handleMouseLeave = () => { | ||
setHoveredUser(null); | ||
}; | ||
return ( | ||
<S.ManagerStyle> | ||
<div> | ||
<S.ManagerButton | ||
onClick={togglePopup} | ||
onMouseEnter={() => handleMouseEnter(selectedUserName || '')} | ||
onMouseLeave={handleMouseLeave} | ||
> | ||
{selectedUserImg ? <img src={selectedUserImg} /> : 'M'} | ||
{hoveredUser && <S.HoverUser>{hoveredUser}</S.HoverUser>} {/* 이름 : {name.username} */} | ||
</S.ManagerButton> | ||
{showPopup && ( | ||
<Members users={users} onSelectUserImg={handleSelectUserImg} onSelectUserName={handleSelectUserName} /> | ||
)} | ||
</div> | ||
{section.map(section => ( | ||
<S.ManagerText>{section.username}</S.ManagerText> | ||
))} | ||
</S.ManagerStyle> | ||
); | ||
}; | ||
|
||
export default ActionItemTask; |
Oops, something went wrong.