diff --git a/src/assets/UserProfile1.png b/src/assets/UserProfile1.png new file mode 100644 index 0000000..f411a96 Binary files /dev/null and b/src/assets/UserProfile1.png differ diff --git a/src/assets/UserProfile2.png b/src/assets/UserProfile2.png new file mode 100644 index 0000000..1387298 Binary files /dev/null and b/src/assets/UserProfile2.png differ diff --git a/src/components/writeRetro/ActionItems/Members.tsx b/src/components/writeRetro/ActionItems/Members.tsx new file mode 100644 index 0000000..67e9546 --- /dev/null +++ b/src/components/writeRetro/ActionItems/Members.tsx @@ -0,0 +1,32 @@ +import * as S from '@/styles/writeRetroStyles/Members.styles'; + +interface UserListProps { + users: { name: string; image: string }[]; + onSelectUserImg: (image: string) => void; + onSelectUserName: (name: string) => void; +} + +export const Members: React.FC = ({ users, onSelectUserImg, onSelectUserName }) => { + const handleUserClick = (name: string, image: string) => { + onSelectUserName(name); + onSelectUserImg(image); + }; + + return ( + <> + + + 해당 업무의 담당자를 지정해주세요 + + + + + ); +}; +export default Members; diff --git a/src/components/writeRetro/task/TeamTask.tsx b/src/components/writeRetro/task/TeamTask.tsx index 73d2537..b06aa99 100644 --- a/src/components/writeRetro/task/TeamTask.tsx +++ b/src/components/writeRetro/task/TeamTask.tsx @@ -7,6 +7,9 @@ import dayjs from 'dayjs'; import TeamTaskMessage from './taskMessage/TeamTaskMessage'; import { sectionData } from '@/api/@types/Section'; import { SectionServices } from '@/api/services/Section'; +import UserProfile1 from '@/assets/UserProfile1.png'; +import UserProfile2 from '@/assets/UserProfile2.png'; +import Members from '@/components/writeRetro/ActionItems/Members'; import ReviseModal from '@/components/writeRetro/task/ReviseModal'; import { useCustomToast } from '@/hooks/useCustomToast'; import * as S from '@/styles/writeRetroStyles/Layout.style'; @@ -46,6 +49,38 @@ const TeamTask: FC = ({ name }) => { } }; + // action items 담당자 지정 + const [hoveredUser, setHoveredUser] = useState(null); + const [showPopup, setShowPopup] = useState(false); + const [selectedUserName, setSelectedUserName] = useState(null); + const [selectedUserImg, setSelectedUserImg] = useState(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 ( <> @@ -77,9 +112,23 @@ const TeamTask: FC = ({ name }) => { {name.sectionName === 'Action Items' && (
- M + handleMouseEnter(selectedUserName || '')} + onMouseLeave={handleMouseLeave} + > + {selectedUserImg ? : 'M'} + {hoveredUser && {hoveredUser}} {/* 이름 : {name.username} */} + + {showPopup && ( + + )}
- {name.username} + 담당자
)} diff --git a/src/styles/writeRetroStyles/Layout.style.ts b/src/styles/writeRetroStyles/Layout.style.ts index bdf0b91..ab8396e 100644 --- a/src/styles/writeRetroStyles/Layout.style.ts +++ b/src/styles/writeRetroStyles/Layout.style.ts @@ -414,6 +414,7 @@ export const ManagerButton = styled.button` &:hover { cursor: pointer; } + position: relative; `; export const ReviseModalStyle = styled.div` @@ -479,3 +480,15 @@ export const ReviseModalButton = styled.button` border-radius: 4px; margin-right: 30px; `; + +export const HoverUser = styled.span` + position: absolute; + width: 40px; + left: -5px; /* 원하는 만큼의 왼쪽 이동 값 설정 */ + top: 100%; +`; + +export const ActionItemsUserImg = styled.img` + width: 24px; + height: 24px; +`; diff --git a/src/styles/writeRetroStyles/Members.styles.ts b/src/styles/writeRetroStyles/Members.styles.ts new file mode 100644 index 0000000..71d36ce --- /dev/null +++ b/src/styles/writeRetroStyles/Members.styles.ts @@ -0,0 +1,49 @@ +import styled from 'styled-components'; + +export const ListConatiner = styled.div` + position: absolute; + z-index: 1; + width: 280px; + max-height: 350px; + overflow-y: auto; + border: 1px solid #c8c8c8; + border-radius: 10px; + background-color: #f4f4f4; +`; + +export const Title = styled.span` + color: #969696; +`; + +export const TitleContainer = styled.div` + background-color: #f0f0f0; + border-top-right-radius: 10px; + border-top-left-radius: 10px; + border-bottom: 1px solid #e5e5e5; + padding: 10px; +`; + +export const ListBox = styled.ul``; + +export const ListItem = styled.li` + list-style: none; + display: flex; + flex-direction: row; + margin-top: 10px; + margin-bottom: 10px; + color: #969696; + &:hover { + cursor: pointer; + } +`; + +export const ProfileImage = styled.img` + margin-left: 5px; + margin-right: 5px; + width: 30px; + height: 30px; +`; + +export const UserName = styled.span` + padding-left: 10px; +`;