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

Main page/#97 #99

Merged
merged 11 commits into from
May 11, 2024
Merged

Main page/#97 #99

merged 11 commits into from
May 11, 2024

Conversation

gahyuun
Copy link
Member

@gahyuun gahyuun commented May 8, 2024

📌 작업 내용

구현 내용 및 작업 했던 내역

  • main page 구현
  • lecture search test 실패 수정
  • drawer overlay 클릭하면 drawer close 구현

🤔 고민 했던 부분

  • main page는 (sub-page) 폴더 내부에 존재하는 게 아닌 app 폴더 내부에 존재합니다 이렇게 되면 몇몇 불편한점이 있습니다
  • 페이지 컴포넌트를 만들기 애매하다
  • 프로젝트를 봤을 때 페이지 관련한 컴포넌트들은 (sub-page)에 있을 것이라고 예상되지만, 메인 페이지만 동 떨어져있는 느낌입니다

그렇다면 main page의 url을 /home 으로 변경하고 / 페이지 진입 시 redirect 시키는 방법이 있습니다 하지만 이 방법도 문제가 있습니다

  • (sub-page)의 layout이 main page에는 적용되면 안되기 때문에 폴더 구조가 추가적으로 변경되어야 할 것 같습니다

두 방법의 단점을 고려해보았을 때, 후자를 채택할 정도로 페이지 컴포넌트가 필요하지 않아서 따로 main 폴더를 만들지 않았습니다.

@gahyuun gahyuun self-assigned this May 8, 2024
Copy link

github-actions bot commented May 8, 2024

Copy link

github-actions bot commented May 8, 2024

Copy link

github-actions bot commented May 8, 2024

Copy link
Member

@yougyung yougyung left a comment

Choose a reason for hiding this comment

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

수고하셨습니다 ~

</head>
<body>
<div className="bg-white">
<Provider>
<MSWComponent>
<NavigationBar />
Copy link
Member

Choose a reason for hiding this comment

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

<NavigationBar />는 메인페이지에도 적용되어야하는 요소 같은데 (sub-page)의 layout으로 옮겨주신 이유가 무엇인가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

Main page에서는 전체 페이지를 감싸는 요소가 있는데 이 안에서 navigation bar가 존재해야 하기때문에 main page가 존재하지 않는 sub page의 layout으로 옮겨줬습니다!

<div className="bg-primary w-[100vw] h-[100vh] overflow-hidden relative">
<NavigationBar />
<Responsive minWidth={768}>
<Image src={mainBookBackground} alt="main-book-background" className="fixed right-0 w-[60%] z-0" />
Copy link
Member

Choose a reason for hiding this comment

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

width과 height를 지정하지않았는데 warning이 발생하지 않았나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

넵 경고는 뜨지 않는데 혹시 문제가 될까요?

Comment on lines +70 to +75
await step('drawer 외부 overlay를 클릭하면 drawer가 닫힌다', async () => {
const drawerOverlay = await screen.findByTestId('drawer-overlay');
await userEvent.click(drawerOverlay);
const toggleLectureSearch = await screen.findByTestId('toggle-lecture-search');
expect(toggleLectureSearch).toBeInTheDocument();
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • draw 닫는 시나리오를 추가하여 테스트 실패를 해결한 것 같은데, 시나리오마다 환경을 초기화하는 방법은 없었을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

decorator를 사용해서 play 전에 특정 로직을 실행시킬 수 있습니다! 그래서 decorator에 play 전에 drawer를 닫는 로직을 넣어봤습니다.
drawer가 항상 존재하는 것은 아니기에 if( screen.findByTestId('drawer-overlay') ) 코드로 drawer 존재 여부에 따라 분기처리를 하려했는데 drawer-overlay element가 존재하지 않다고 오류를 뿜어버립니다. 현재로서 이 분기처리를 마땅히 해결 할 코드를 찾지 못했습니다 🥹
아직 중복되거나 큰 문제가 되지 않아서 추후에 중복이 되거나 이럴때 더 찾아봐도 될까요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

  • 아하 혹시나 스토리북에 있는 reset button처럼 이를 수동으로 트리거할 수 있는 API가 스토리북에서 제공되지 않을까 생각해서, 이에 대해 알고 있는지 궁금해서 질문했습니다.
  • 지금은 중복되거나 큰 문제가 되진 않으니 나중에 필요할 때 찾아보셔도 좋을 것 같습니다. 저도 찾아보겠습니다

@gahyuun gahyuun merged commit 779c16c into main May 11, 2024
3 checks passed
@gahyuun gahyuun deleted the main-page/#97 branch May 11, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants