Skip to content
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

[#301] 프로필 공유 모달 제작 #317

Merged
merged 20 commits into from
Jun 16, 2024
Merged

Conversation

Ethen1264
Copy link
Contributor

💡 배경 및 개요

프로필 공유 하기 위해 프로필 모달을 제작 해야했습니다.

image

Resolves: #301

📃 작업내용

프로필 공유 모달을 제작 하였습니다.

@Ethen1264 Ethen1264 added 2️⃣ Priority: Medium 우선순위 - 중 ✨ Feature 신규 기능 labels Jun 4, 2024
@Ethen1264 Ethen1264 self-assigned this Jun 4, 2024
Copy link

vercel bot commented Jun 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sms ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2024 1:41pm


const createSheareProfilService = async (
studentId?: string,
periodDay?: number | undefined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

타입은 둘다 필수로 변경하고, periodDay는 number로 변경하는편이 좋을거같아요.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f0d1816
수정했습니다
기본값을 설정해둔걸 잊어버렸어요 ㅠㅠㅠ

Comment on lines 8 to 24
isModalOpen?: boolean
}

/**
* 배경은 blur로 되어 있음
*/
const BlurPortal = ({ children }: Props) => {
const BlurPortal = ({ children, isModalOpen }: Props) => {
const portalValue = usePortal(true)

if (!portalValue) return <></>
if (!portalValue) return null

const { onClick, onClose, portal } = portalValue

const handleClick = isModalOpen ? undefined : onClose

return ReactDOM.createPortal(
<S.Wrapper onClick={onClose}>
<S.Wrapper onClick={handleClick}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isModalOpen 필요 없습니다
features/modal/stores/modalSlice 를 참고해주세요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isModalOpen은 사용자의 디테일 모달 위에 사용자 프로필 공유 모달이 생성 되었는지 아닌지 판단하고 생성 되었다면 handleClick을 undefined로 바꾸고 사용자 프로필 공유 모달이 생성되지 않았다면 onClose로 바꾸기 위해 사용했었습니다.
그렇지만 위에서 말씀 하신 것 처럼 isModalOpen이 필요하지 않다고 하셔서 isModalOpen로직을 지우고 동작을 해본 결과 두개의 모달이 겹칠 때 아무대나 클릭을 해도 모달이 둘다 닫쳐 버리는 문제가 있어 이벤트 버블링 문제라고 판단하여 504be94 이와 같이 수정해봤습니다!

Comment on lines 42 to 50
const fetchAccessService = async () => {
if (!data) {
router.push('/', '/')
return
}
onShow(<StudentDetailModal studentId='' student={data} />)
}

onShow(<StudentDetailModal studentId='' student={data} />)
fetchAccessService()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 뭐...
달라진게 없는데?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모달을 다 수정하고 git pull origin develop을 했는데 충돌이 나서 rebase로 해결을 했는데 그 과정에서 전에 올라간 것들이 한번 덮어 씌어진 것 같아요

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그 전으로 되돌리는 게 좋을 것 같은데
비동기 처리도 안 하면서 굳이 async 함수까지 만들 필요는 없는 것 같은데
오히려 복잡성만 높아진듯

.editorconfig Outdated Show resolved Hide resolved
Comment on lines 42 to 50
const fetchAccessService = async () => {
if (!data) {
router.push('/', '/')
return
}
onShow(<StudentDetailModal studentId='' student={data} />)
}

onShow(<StudentDetailModal studentId='' student={data} />)
fetchAccessService()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그 전으로 되돌리는 게 좋을 것 같은데
비동기 처리도 안 하면서 굳이 async 함수까지 만들 필요는 없는 것 같은데
오히려 복잡성만 높아진듯

Copy link
Member

@chanwoo00106 chanwoo00106 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isModalOpen 이 좀 아쉽긴 한데
일단 빨리 merge 해버리자

@Ethen1264 Ethen1264 merged commit c1d9712 into develop Jun 16, 2024
3 checks passed
@chanwoo00106 chanwoo00106 deleted the feature/profileShareModal branch June 16, 2024 13:54
@chanwoo00106 chanwoo00106 mentioned this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2️⃣ Priority: Medium 우선순위 - 중 ✨ Feature 신규 기능
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants