-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(web-domains): 공통 모달 컴포넌트 #71
Conversation
@Andrevile 어떻게 사용하는지 PR 설명에 함 적어주실 수 있나영 🙇🏻♀️ |
@Doeunnkimm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다~
transform: 'translate(-50%, -50%)', | ||
backgroundColor: colors.white, | ||
borderRadius: borderRadiusVariants.medium, | ||
zIndex: '10000', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 createPortal 사용하면 zIndex 필요 없지 않나요? 🤔
const [modalState, setIsModalState] = useState<boolean>(isOpen); | ||
const [element, setElement] = useState<HTMLElement | null>(null); | ||
|
||
const modalWidth = width ? `${width}px` : '100%'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
모바일 뷰라서 너비를 만질 일이 많이 없을 것 같은데
prop에서 width 제거하고, 내부에서는 제일 많이 사용하는 너비로 width 고정적으로 스타일링하는 것 어떠신가용 ? (maxWidth === 기본 width로..?)
진짜 만약 필요하면 사용처에서 스타일 오버라이드 하라고 하죠 ~!
if (typeof window === 'undefined') { | ||
return <></>; | ||
} | ||
|
||
if (!element) { | ||
return <></>; | ||
} | ||
|
||
if (!isOpen) { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 조건 싸그리 묶어서 그냥 얼리 리턴 해도 될듯..? (리팩터링 느낌으로..)
어차피 모달 렌더링 안 하겠다 의미 맞죵 ?
f04c84e
to
69893bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
요 모달 isOpen의 초기값이 false면 true로 변경이 안되네여~~ 즉 처음부터 모달을 띄우는 상황이 아닌, 어떤 요소를 클릭해서 모달을 띄우고자 할 때 사용이 불가합니다 ㅠ |
🎉 변경 사항
🔗 링크
🙏 여기는 꼭 봐주세요!