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

[REFACTOR] SongDetailPage및 Youtube 컴포넌트 리팩토링 #143

Closed
8 tasks done
Creative-Lee opened this issue Jul 28, 2023 · 0 comments · Fixed by #179
Closed
8 tasks done

[REFACTOR] SongDetailPage및 Youtube 컴포넌트 리팩토링 #143

Creative-Lee opened this issue Jul 28, 2023 · 0 comments · Fixed by #179
Assignees
Labels
[ 🌞 FE ] 프론트엔드 크루들의 빛나는 개발 이야기 하나둘셋 호! 🔨 Refactor 꾸준한 개선이 더 나은 애플리케이션을 만든다

Comments

@Creative-Lee
Copy link
Collaborator

Creative-Lee commented Jul 28, 2023

🤷 개선할 기능

SongDetailPage 컴포넌트 및 유튜브 API 컴포넌트 리팩토링
(작업에 따라 이슈 분리 예정)

🔨 상세 작업 내용

킬링파트 등록 관련 상태를 공유하는 Context 생성 및 적용

유튜브 플레이어 관련 상태를 공유하는 Context 생성 및 적용

VideoSlider 리팩토링

  • 컴포넌트 내 로직 정리
  • 내부 로직 훅 분리

Youtube 리팩토링

  • 컴포넌트 내 로직 정리
  • iframe api 로직 정리

SongDetailPage 리팩토링

  • 컴포넌트 및 스타일 분리
  • 컴포넌트 내 로직 훅 분리

⏰ 예상 작업 시간

테스크 당 24시간 이내

⏰ 마감일

7월 30일

@Creative-Lee Creative-Lee self-assigned this Jul 28, 2023
@Creative-Lee Creative-Lee added [ 🌞 FE ] 프론트엔드 크루들의 빛나는 개발 이야기 하나둘셋 호! 🔨 Refactor 꾸준한 개선이 더 나은 애플리케이션을 만든다 labels Jul 28, 2023
Creative-Lee added a commit that referenced this issue Aug 3, 2023
* refactor: 사용하지 않는 결과 메세지 및 태그 스타일 정리

* refactor: 변수명 수정

변수 자체에 시간의 의미를 포함

* refactor: 변수명 수정

변수 자체에 시간의 의미를 포함

* refactor: 불필요한 number 변환 코드 제거

* refactor: 유튜브 iframe load api 불필요한 코드 수정

유튜브 ifram api는 https 요청을 받도록 고정되어있는 api이므로 수정하였음.

* refactor(Youtube): 컴포넌트 리팩토링

1. 컴포넌트 내부 불필요한 player 상태 삭제
2. 사용하지 않는 onStateChange 이벤트 핸들러 삭제
3. 외부에서 player 상태 및 setter 를 전달받도록 개선

* refactor: SongDetailPage 컴포넌트 분리 및 계층 생성

* refactor: VoteInterfaceContext 생성 및 훅 추가

VoteInterface 컴포넌트의 각 컴포넌트가 사용할 컨텍스트 생성

* refactor: VoteInterfaceContext 적용 및 컴포넌트 props 수정

컨텍스트에서 제공하는 value에 해당하는 props 제거

* refactor: VoteInterfaceContext 적용에 따른 test case 수정

* refactor: songDetailPage에 존재하던 video 상태 및 구간반복 effect 컨텍스트 내부로 분리

1. 컨텍스트 내부에 상태 격리
2. page 단에 존재하기에 어색했던 구간반복 effetct 격리

* refactor: videoPlayer 상태 컨텍스트 분리로 인한 props 삭제

* refactor: Youtube 컴포넌트 개선

1. 영상 시작점 props 옵셔널 및 기본값 처리
2. 향후 이벤트 사용 가능성을 고려하여, player set 형식 변경
3. 관련 함수 useCallback 처리

* refactor: videoPlayerProvider 생성 및 player 관련 상태 분리

VoteInterface는 특정 컴포넌트 종속적인 provider인것에 비해
VideoPlayer 관련 컴포넌트와 상태는 재사용 할 가능성이 높다고 판단하였음.
이에 따라 provider를 분리하였음.

* refactor: 분리된 videoPlayerContext를 각 컴포넌트에 적용

해당 과정에서 VoteInterfaceContext는 특정 컴포넌트 종속적임을 확정하였음.

* chore: TODO 주석 추가

* refactor: 하드코딩된 songId 대체할 props 추가

* chore: TODO 주석 추가

* design: 기본 박스 스타일링 및 컨테이너 추가

* refactor: provider 태그 위치 변경으로 의미 강조

* refactor: index 파일 생성 및 import 경로 정리

* refactor(Youtube): index 파일 생성 및 import 경로 정리

* refactor: 테스트케이스에 추가된 Context 적용

* design: 사용하지 않는 코드 삭제 및 모달버튼 간격 조정

* feat: 킬링파트 지정 구간을 계산하는 유틸 추가 및 메세지 적용

이미 만들어진 유틸 추가

* fix: songPage에 player context 적용

기존 유튜브 컴포넌트를 활용한 새로운 page에 context 적용

* fix: main pull 후 발생하는 오류 해결

import 경로 수정
@github-project-automation github-project-automation bot moved this from Todo to Done in 2023-shook Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ 🌞 FE ] 프론트엔드 크루들의 빛나는 개발 이야기 하나둘셋 호! 🔨 Refactor 꾸준한 개선이 더 나은 애플리케이션을 만든다
Projects
Status: Done
1 participant