Open
Conversation
- CSS reset - tailwind spacing에 "pxr" suffix 추가 - screen 사이즈 조정 Signed-off-by: kibum.lee <kissyou7@gmail.com>
- TeamMemberCard 컴포넌트 구현 - lucide-react 라이브러리 설치 Signed-off-by: kibum.lee <kissyou7@gmail.com>
- Modal 컴포넌트 구현 - TeamMemberCard 컴포넌트에 Modal 컴포넌트 적용 Signed-off-by: kibum.lee <kissyou7@gmail.com>
- 조건부 tailwind uc 처리 - 중복 tailwind uc 제거 Signed-off-by: kibum.lee <kissyou7@gmail.com>
Signed-off-by: kibum.lee <kissyou7@gmail.com>
- onOpenChange, open prop을 사용하여 외부에서 상태 관리 가능하도록함 - ModalClose 추가 하여, Close 커스텀 가능하도록함 - aria 속성 추가 Signed-off-by: kibum.lee <kissyou7@gmail.com>
- Card 컴포넌트는 공통 적용부분만 분리 - TeamMemberCard의 모달 state 직접관리 - 기타 코드 정리 Signed-off-by: kibum.lee <kissyou7@gmail.com>
- mount, visible 상태 추가 Signed-off-by: kibum.lee(t14) <kissyou7@gmail.com>
fried-jay
reviewed
Apr 21, 2025
| const { visible, closeModal } = useModalContext(); | ||
|
|
||
| useEffect(() => { | ||
| const handleEsc = (e) => { |
There was a problem hiding this comment.
이렇게 하면 모든 domtree에 Modal 이 활성화 되어있을경우에 esc 이벤트가 다 closeModal로 되었던 경험이 있어서
useRef()로 사용해서 해당 node에 event 걸면 어떨까요??
fried-jay
reviewed
Apr 21, 2025
| const isOpen = open ? open : _open; | ||
|
|
||
| const openModal = useCallback(() => { | ||
| onOpenChange && onOpenChange(true); |
There was a problem hiding this comment.
현재는 context provider를 사용하고 있으신데 onOpenChange,setOpen을 하나로 통합 할 수 있을거같은데 제가 contextValue는 사용해보지 않아서 ㅠㅠ 혹시 방법이 없을까욤
제 경우,
전역상태라이브러리 관리를 썼을경우에는 부모 컴포넌트에서 전역상태를 수정하면 자식에서도 수정되는 형식으로
const Modal = ({ children }: Props) => {
const { toggleModal } = useModalStore();
return (
<div>
<div className={styles['modal-overlay']} onClick={toggleModal}></div>
<div className={styles['modal-content-container']}>
<div className={styles['modal-content']}>
<h1>모달테스트</h1>
{children}
<button
onClick={toggleModal}
className={styles['modal-close-button']}
type='button'
>
닫기
</button>
</div>
</div>
</div>
);
};
export default Modal;
이런식으로
useModalStore 상태를 바꿔줬던것 같습니다. !
- mount 상태에 따른 content 렌더링 버그 수정 - ModalTrigger 버그수정 Signed-off-by: kibum.lee <kissyou7@gmail.com>
- ModalClose 존재하지 않는경우 Default 스타일로 ModalClose 스타일 적용 Signed-off-by: kibum.lee <kissyou7@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1주차 과제 - TeamMemberCard 만들기
개요
팀원들의 카드리스트를 만들고 클릭시 상세 정보를 보여준다.
구현 내용
1. 기본과제
2. 선택과제
3. 기타
tailwind spacing UC(utilitycase) extend
p-20pxr⇒1.25rem으로 자동 적용cn util ( tailwind-merge, clsx 사용)
추가 Library
주요 학습내용
1. radix ui 스타일의 컴포넌트 구현
2. 사용 기술
createContext,useContext)openModal,closeModal,open)를 하위 컴포넌트에 공유하기 위해 사용createPortal)document.body에 렌더링하여 레이어 분리, z-index 문제 방지.Children,isValidElement)children을 검사 및 조건 분기 처리UI/UX 특징
1. 반응형