Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@NYeonK
Copy link
Contributor

@NYeonK NYeonK commented Feb 25, 2023

  • 브랜치명, 브랜치 알맞게 설정
  • Reviewer, Assignees, Label, Milestone, Issue(PR 작성 후에) 붙이기
  • PR이 승인된 경우 해당 브랜치는 삭제하기

📌 내용

  • 메뉴바에 북마크 바로가기 버튼을 추가했습니다.
  • 메뉴바의 오퍼시티 클릭 시, 메뉴바 닫기
  • 대화 주제 카드의 서브텍스트를 변경했습니다.
  • 메뉴바 UI를 업데이트 했습니다. (폰트, 크기 등)

📌 질문할 부분

  • 메뉴바 버튼들을 map으로 돌리고자 시도를 했으나,, 되돌렸습니다,,
    <link to = {} /> 여기 router 부분도 따로 빼려고 했는데 아래 코드에서 ballotLists는 안에서 선언한거라 못빼더라구요?-?
    으떠한 방법이 있을까나요😵
`${routePaths.Vote}/${ballotLists?.data[0]._id}`

📸 스크린샷

Copy link
Member

@joohaem joohaem left a comment

Choose a reason for hiding this comment

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

아주 나이쓰 !!!!~!!🙏🏼👍🏼👍🏼👍🏼

Comment on lines 33 to 37
const openElement = useOutClickCloser({
handleOutClickCloser: () => {
closeMenuBar();
},
});
Copy link
Member

@joohaem joohaem Feb 26, 2023

Choose a reason for hiding this comment

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

아 이제 아웃클릭 코드들 보니까 되게 신기하게 짰네???

먼가 더 보편적인 방법으로는,

export default function useOutClickCloser(handleOutClickCloser: () => void;) {

이렇게 props 인자가 아닌, 콜백함수 인자로 받아와서

Suggested change
const openElement = useOutClickCloser({
handleOutClickCloser: () => {
closeMenuBar();
},
});
const outClickRef = useOutClick(closeMenuBar); //ref 임을 명시해주는 변수명이 더 좋을 것 같아!

나라면 이런 식으로 사용할 것 같다 !!

객체로 감싸서 넘겨주는 게, 그 "객체 안에 내용"만 바뀌면 "바뀐 줄 모르는" 현상이 일어나서
저렇게 인자 인수 형태로 넘겨주는 게 더 좋지 않을까 싶다!

이 외에도, 컴포넌트에서도 prop로 넘겨줄 때 객체형보다는 최대한 원시 자료형으로 객체를 분리해서 하나하나 넘겨주는 게 더 정확하고 효율적으로 렌더링(최적화) 되거든!

Copy link
Contributor Author

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.

useOutClickuseOutClickCloser 요거를 바꿔서 쓴걸까요?-?

@joohaem joohaem changed the base branch from develop to release/1.3 February 26, 2023 01:24
Copy link
Member

@joohaem joohaem left a comment

Choose a reason for hiding this comment

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

바깥 영역 클릭할 때, 그 바깥 영역에서의 클릭을 어떻게 막을 수 있을까??

ex) 모바일에서 메뉴바 바깥에 카드를 누르면, 메뉴바가 없어지지만 카드뷰로도 넘어감

@joohaem joohaem merged commit 0aab7fa into release/1.3 Feb 26, 2023
@joohaem joohaem deleted the feat/#213-menubar branch February 26, 2023 13:31
Copy link
Contributor Author

@NYeonK NYeonK left a comment

Choose a reason for hiding this comment

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

고마워용🥰❤


export default function useOutClickCloser(props: UseOutClickCloserProps) {
const { handleOutClickCloser } = props;
type HandleOutClickCloser = () => void;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

아항 요로코롬 하는 거구나👀👀 배워갑니다아><

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Common - MenuBar ] 북마크 메뉴 추가 및 오퍼시티 클릭 시, 닫기 기능 구현

3 participants