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

Skip to content

Conversation

@NYeonK
Copy link
Contributor

@NYeonK NYeonK commented Mar 8, 2023

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

📌 내용

  • MainPage의 Medley 기능을 구현했습니다.

⭐ 추가해야 하는 부분 ⭐

  • medley 그라데이션 따로 정리
  • DB 반영되면, 작동 확인
  • modal 애니메이션 넣기 + modal 작동 확인😥

📌 질문할 부분

  • Medley Content를 누르면, preview로 관련 정보가 넘어가야 하는데 좋은 방법이 있을까요!!
    코드 맨 하단의 {isModalOpen && <MedleyPreview closePreview={toggleModal} />}에 props로 전달하고 싶었는데,
    자리를 옮기면 에러가 계속 나네요,,?😥😥
          <St.MedleyContainer isClicked={isModalOpen}>
            {medleyLists &&
              medleyLists.data.map((medleyLists) => {
                return (
                  <St.MedleyWrapper key={medleyLists._id} onClick={toggleModal}>
                    <St.ContentTag>{medleyLists.sticker}</St.ContentTag>
                    <St.ContentTitle>{medleyLists.title}</St.ContentTitle>
                  </St.MedleyWrapper>
                );
              })}
          </St.MedleyContainer>
          {isModalOpen && <MedleyPreview closePreview={toggleModal} />}
  • 아래 코드에서 item은 사용안하는데, 제거하면 오류가 나는 이유를 아실까요?-?
                  {medleyLists.previewCards.map((item: object, i: number) => {
                    return <St.CardWrapper key={i}>{medleyLists.previewCards[i].content}</St.CardWrapper>;
                  })}

📸 스크린샷

KakaoTalk_20230309_061218095.mp4

@NYeonK NYeonK linked an issue Mar 8, 2023 that may be closed by this pull request
7 tasks
@NYeonK NYeonK self-assigned this Mar 8, 2023
@NYeonK NYeonK added this to the 🦄 스프린트2 🦄 milestone Mar 8, 2023
@NYeonK NYeonK marked this pull request as draft March 8, 2023 17:35
@NYeonK NYeonK marked this pull request as ready for review March 8, 2023 21:13
@NYeonK NYeonK requested a review from joohaem March 8, 2023 21:14
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.

항상 예상을 뛰어넘는🔥 ........ 나연이의 실력🔥🔥🔥🔥
최고다🦾🦾
앞으로 많이 부탁할게!!!!!!!!!!!!!!!!! 고생해쒀

  1. 백그라운드 로직
    이건 내가 생각 해봤는데, const 상수에 Map 객체를 사용해서
    key: 특정 메들리의 _id 값 / value: 백그라운드 칼라값
    으로 구성해서 이 객체를 불러다가 넣어주면 될 것 같아!!!!
    그러면 가영이가 원하는 디자인적인 요소의 분리도 이루어지고, 클라에서도 유연성 있게 설계가 될 것 같당

  2. 로딩 로직
    이건 내가 api들 다 swr로 치환하고, 로딩 로직들 Suspense로 치환하는 작업을 하려고 해!
    이번주 내로 해볼게 !!!

Comment on lines 23 to 26
const moveMedley = (id: string) => {
navigate(routePaths.CardCollection, { state: { type: "medley", medleyId: id } });
setSliderIdx(0);
};
Copy link
Member

Choose a reason for hiding this comment

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

이거를 useMedleyLists 훅 안에 넣어놔도 되겠다!
다른 것들도 다 그래야겠네 하하하~.~

  1. string으로 직접 써주는 type 값을 const 상수로 빼내는 게 좋을 것 같다!
  2. setSliderIdx(0) 일 경우에, 안써도 되도록 하는 방안이 뭐가 있을까?
  3. moveMedley -> moveCardCollectionFromMedley 같은 이름이 어떨지 ???

Comment on lines 12 to 14
interface MedleyPreviewProps {
closePreview: () => void;
}
Copy link
Member

Choose a reason for hiding this comment

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

❗ 질문1

프리뷰 컴포넌트게서 메들리리스트의 정보가 모두 필요한가요?
아니면 한 메들리의 프리뷰 정보가 필요한가요??

  1. 카드의 인덱스가 필요함 -> medleyIdx: number;
  2. 특정 메들리의 프리뷰 정보가 필요함 -> {...previewCards} 를 prop으로 받음. _id: string, content: string
  3. 특정 메들리의 정보도 필요 -> title: string, ...

이것들을 다 props 로 받아주면 될 것 같고-

Copy link
Contributor Author

@NYeonK NYeonK Mar 10, 2023

Choose a reason for hiding this comment

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

/* 폴더 구조 */
Medley
 └── MedleyPreiveiw
 └── MedleyCard

구조가 위와 같은데, MedleyPreiveiwMedleyCard에서 사용합니당.

그래서 Medley에서 api 연결하구 props 전달해주려고 하는데,
MedleyCard에서는 preview 정보가 필요없거든요! 그래도 props로 전부 받아서 넘겨줘야 할까요?-?

아니면 MedleyPreiveiw에서 api 한 번 더 쓰는 방법이 더 나을지 궁금합니다.!

Copy link
Member

Choose a reason for hiding this comment

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

api 통신을 한 번 더 하는 건 정말 불필요한 작업같고,

부분 전역적으로 사용하는 context를 사용할 수도 있겠지만
뎁스가 길지도 않아서, prop drilling 하는 게 나아보여요-

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네엡 감사합니당:D

Comment on lines 29 to 30
<St.Root>
<St.Container ref={outClickCloserRef}>
Copy link
Member

Choose a reason for hiding this comment

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

Modal 공통 컴포넌트 사용해주세요!

Copy link
Member

@joohaem joohaem Mar 9, 2023

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.

Modal이 있었네 맞네ㅎㅎ 바루 반영할게요!

Comment on lines 19 to 27
{medleyLists &&
medleyLists.data.map((medleyLists) => {
return (
<St.MedleyWrapper key={medleyLists._id} onClick={toggleModal}>
<St.ContentTag>{medleyLists.sticker}</St.ContentTag>
<St.ContentTitle>{medleyLists.title}</St.ContentTitle>
</St.MedleyWrapper>
);
})}
Copy link
Member

Choose a reason for hiding this comment

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

❗ 질문1

{isModalOpen && <MedleyPreview closePreview={toggleModal} />} 를 이 안에 넣어줘야겠지?

return 안의 요소들을 MedleyCard 로 따로 빼내고,
그 안에서 useModal 훅을 사용해서 각 카드에 독립적인 모달을 만들어주면 될 것 같은데!

어떤 에러가 나는지 잘 모르겠어. 자세히 설명해줄래?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

웅 거마워:D 오빠가 말한대러 다시 해볼게!! 왜 빼낼 생각을 안했으까😂😂

@NYeonK
Copy link
Contributor Author

NYeonK commented Mar 9, 2023

@joohaem HELP ME😂

  • Modal 적용했는데, 사진과 같이 뜹니다,,,! 어느 부분잉 문제일까여ㅠ
  • Modal theme이 두가지가 있는데, 이번에는 그레이 색상이거둔여,,! 그럼 theme에 추가해야 될까요?

@joohaem
Copy link
Member

joohaem commented Mar 10, 2023

  1. 스크린샷 보고는 알 수 없어요... 트러블 슈팅을 하고 어느 부분에서 문제가 생기는 것 같은데, 왜 이렇게 될까요? 정도로 질문해주시면 제가 좀 편할 것 같습니다,,
  2. 네! 추가해주세요!! 너무 다르다싶으면 분리해도 좋아요

?. 카드 주제 제목으로 오는 데이터들에 줄바꿈 표시도 함께 오나요?? 온다면 pre-wrap 해줘야 할 것 같아요!!

@NYeonK
Copy link
Contributor Author

NYeonK commented Mar 10, 2023

아하 한 번 더 확인하고 다시 질문해보겠습니다! 알려주셔서 감사해요 (。˃́⌔˂̀。)

카드 주제 제목들은 줄바꿈 요청한 게 아직 반영이 안 돼서, 이후에 확인해보겠습니다!!

@joohaem
Copy link
Member

joohaem commented Mar 12, 2023

남은 것

    • props drilling 해서 프리뷰 컴포넌트 금방
    • 서버 데이터 (줄바꿈 등) 적용 확인
    • Modal 손보기 해봐야 앎
    • 애니메이션

@joohaem joohaem merged commit 5b47bf5 into release/1.3 Mar 12, 2023
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.

[ Main ] 메인 페이지 메들리 기능 구현

3 participants