diff --git a/src/components/Team/TeamManage/MemberAddModal.tsx b/src/components/Team/TeamManage/MemberAddModal.tsx new file mode 100644 index 0000000..a38332d --- /dev/null +++ b/src/components/Team/TeamManage/MemberAddModal.tsx @@ -0,0 +1,68 @@ +import { theme } from '@/style/theme'; +import styled from '@emotion/styled'; + +export const Wrapper = styled.div` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 20px; + width: 100%; + height: 100%; + & ::-webkit-scrollbar { + width: 4px; + } + & ::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + border-radius: 4px; + } +`; + +export const TopContainer = styled.div` + width: 480px; + display: flex; + flex-direction: column; + align-items: start; + gap: 34px; + > div:first-of-type { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 20px; + font-weight: 600; + } +`; + +export const MiddleContainer = styled.div` + width: 480px; + height: 340px; + overflow-y: auto; + display: flex; + flex-direction: column; + gap: 10px; +`; + +export const MemberBox = styled.div` + width: 100%; + height: 60px; + flex: none; + border-radius: 20px; + padding: 0 20px; + display: flex; + justify-content: space-between; + align-items: center; + border: 1px solid ${theme.color.gray4}; +`; + +export const BottomContainer = styled.div` + display: flex; + flex-direction: column; + gap: 10px; + align-items: end; + width: 480px; + > div:first-child { + font-size: 18px; + font-weight: 500; + } +`; diff --git a/src/components/Team/TeamManage/MemberManageModal.tsx b/src/components/Team/TeamManage/MemberManageModal.tsx new file mode 100644 index 0000000..cccb2aa --- /dev/null +++ b/src/components/Team/TeamManage/MemberManageModal.tsx @@ -0,0 +1,30 @@ +import { theme } from '@/style/theme'; +import styled from '@emotion/styled'; + +export const Wrapper = styled.div` + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 20px; + > div { + width: 478px; + } + > div:nth-of-type(1) { + font-size: 20px; + font-weight: 600; + color: ${theme.color.gray8}; + } + > div:nth-of-type(2) { + font-size: 18px; + font-weight: 500; + color: ${theme.color.gray7}; + } + > div:nth-of-type(3) { + display: flex; + justify-content: end; + gap: 10px; + } +`; diff --git a/src/components/Team/TeamManage/ThreeDotMenu.tsx b/src/components/Team/TeamManage/ThreeDotMenu.tsx new file mode 100644 index 0000000..52c04c7 --- /dev/null +++ b/src/components/Team/TeamManage/ThreeDotMenu.tsx @@ -0,0 +1,39 @@ +import { css } from '@emotion/react'; +import styled from '@emotion/styled'; +import { theme } from '@/style/theme'; + +export const Wrapper = styled.div` + width: 134px; + padding: 0 12px; + border-radius: 4px; + border: 1px ${theme.color.gray5} solid; + background-color: ${theme.color.gray1}; + position: absolute; + margin-top: 8px; + z-index: 10; + top: 16px; +`; + +export const Box = styled.div<{ isLast: string }>` + width: 100%; + font-size: 12px; + font-weight: 400; + color: ${theme.color.gray7}; + height: 46px; + display: flex; + justify-content: center; + align-items: center; + cursor: pointer; + transition: 0.1s linear; + ${({ isLast }) => { + return ( + isLast === 'false' && + css` + border-bottom: 1px ${theme.color.gray5} solid; + ` + ); + }}; + :hover { + color: ${theme.color.mainDark1}; + } +`; diff --git a/src/pages/Team/Manage.tsx b/src/pages/Team/Manage.tsx index e804e4b..1e4d73c 100644 --- a/src/pages/Team/Manage.tsx +++ b/src/pages/Team/Manage.tsx @@ -1,14 +1,16 @@ import { useState } from 'react'; +import { useOutsideClick } from '@/hooks/useOutsideClick'; +import { useModal } from '@/hooks/useModal'; import styled from '@emotion/styled'; import { Sidebar } from '@/components/common/sidebar'; import { theme } from '@/style/theme'; import { SearchBar } from '@/components/common/SearchBar'; import { XButton } from '@/components/common/XButton'; -import { useModal } from '@/hooks/useModal'; -import * as MemberAddModal from '@/components/Team/TeamManage/MemberAddModal'; import { Icon } from '@iconify/react'; import { Tag } from '@/components/Team/Tag'; -import { DropMenu } from '@/components/common/DropMenu'; +import * as MemberAddModal from '@/components/Team/TeamManage/MemberAddModal'; +import * as MemberManageModal from '@/components/Team/TeamManage/MemberManageModal'; +import * as ThreeDotMenu from '@/components/Team/TeamManage/ThreeDotMenu'; const dummyMember: string[] = [ '0000 테스트', @@ -25,18 +27,18 @@ const dummyMember: string[] = [ '0000 테스트', ]; -const array: string[] = ['담당자 지정', '팀원 삭제']; - export const TeamManage = () => { const [isOpen, setIsOpen] = useState(false); - + const ref = useOutsideClick(() => { + setIsOpen(false); + }); const { isVisible, onShow, ModalWrapper, onClose } = useModal({ defaultVisible: 'memberDel', }); - function setStudentIndex(index: number): void { - throw new Error('Function not implemented.'); - } + const onOpen = (index: number) => { + if (!isOpen) setIsOpen(index); + }; return ( <> @@ -71,14 +73,50 @@ export const TeamManage = () => { )} - {isVisible === 'memberDel' && ( + {isVisible === 'managerChange' && ( - bye + +
담당자 변경
+
담당자를 김은빈 학생에서 홍길동 학생으로 변경하시겠습니까?
+
+ { + onClose(); + }} + > + 취소 + + + 담당자 변경 + +
+
)} - {isVisible === 'managerChange' && ( + {isVisible === 'memberDel' && ( - good + +
팀원 삭제
+
김은빈 학생을 팀에서 삭제하시겠습니까?
+
+ { + onClose(); + }} + > + 취소 + + + 팀원 삭제 + +
+
)} @@ -123,19 +161,38 @@ export const TeamManage = () => {
{member}
- { - setIsOpen(index); - }} - /> - {isOpen && ( - - )} + + { + onOpen(index); + }} + /> + {isOpen === index && ( + + { + onShow('managerChange'); + }} + > + 담당자 지정 + + { + onShow('memberDel'); + }} + > + 팀원 삭제 + + + )} + ))} @@ -297,3 +354,9 @@ const MemberBox = styled.div` } } `; + +const MemberBoxInRightContainer = styled.div` + display: flex; + justify-content: end; + position: relative; +`;