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] 리액트 폴더 구조 개선 #276

Closed
1 task done
rbgksqkr opened this issue Sep 20, 2024 · 0 comments · Fixed by #399
Closed
1 task done

[REFACTOR] 리액트 폴더 구조 개선 #276

rbgksqkr opened this issue Sep 20, 2024 · 0 comments · Fixed by #399
Assignees
Labels
🫧 FE front end ♻️ refactor 리팩토링

Comments

@rbgksqkr
Copy link
Contributor

rbgksqkr commented Sep 20, 2024

Description 💭

  • 컴포넌트가 많아지면서 컴포넌트를 찾기 어려워짐
  • 어느 페이지에서 사용되는 컴포넌트인지 파악하기 어려움
  • FSD도 고려해봤지만 팀원 모두에게 익숙하면서 직관적인 디렉토리 구조 채택
  • pages 디렉토리 내에 해당 페이지에 사용되는 컴포넌트 분리(pages > components + index.tsx)

TODO ✅

  • 컴포넌트 분리

현재 폴더 구조

src
 ┣ apis
 ┣ assets
 ┃ ┣ images
 ┣ components
 ┃ ┣ GameResult
 ┃ ┣ GameResultItem
 ┃ ┣ NicknameItem
 ┃ ┣ OptionParticipants
 ┃ ┣ OptionParticipantsContainer
 ┃ ┣ ReadyMembersContainer
 ┃ ┣ RoomSetting
 ┃ ┣ RoundResultTab
 ┃ ┣ RoundVoteContainer
 ┃ ┣ SelectContainer
 ┃ ┃ ┣ Timer
 ┃ ┣ SelectOption
 ┃ ┣ StartButtonContainer
 ┃ ┃ ┣ Countdown
 ┃ ┃ ┣ StartButton
 ┃ ┣ TabContentContainer
 ┃ ┃ ┣ EmptyVoteContent
 ┃ ┃ ┣ StatisticBar
 ┃ ┃ ┣ VoteStatisticContent
 ┃ ┣ TopicContainer
 ┃ ┣ common
 ┃ ┃ ┣ AlertModal
 ┃ ┃ ┣ Button
 ┃ ┃ ┣ DeferredComponent
 ┃ ┃ ┣ Dropdown
 ┃ ┃ ┣ ErrorBoundary
 ┃ ┃ ┣ ErrorFallback
 ┃ ┃ ┃ ┣ AsyncErrorFallback
 ┃ ┃ ┃ ┣ RootErrorFallback
 ┃ ┃ ┃ ┣ RouterErrorFallback
 ┃ ┃ ┃ ┣ SpinnerErrorFallback
 ┃ ┃ ┣ FinalButton
 ┃ ┃ ┣ InviteModal
 ┃ ┃ ┣ Modal
 ┃ ┃ ┣ NextRoundButton
 ┃ ┃ ┣ PrevButton
 ┃ ┃ ┣ QueryClientDefaultOptionProvider
 ┃ ┃ ┣ RoomSettingModal
 ┃ ┃ ┃ ┣ CategoryDropdown
 ┃ ┃ ┃ ┣ RoomSettingContainer
 ┃ ┃ ┣ ScrollLock
 ┃ ┃ ┣ SelectButton
 ┃ ┃ ┣ Skeleton
 ┃ ┃ ┃ ┣ GameSkeleton
 ┃ ┃ ┃ ┗ ReadySkeleton
 ┃ ┃ ┣ Spinner
 ┃ ┃ ┣ Toast
 ┃ ┃ ┗ a11yOnly
 ┃ ┗ layout
 ┃ ┃ ┣ Content
 ┃ ┃ ┗ Header
 ┣ constants
 ┣ hooks
 ┣ mocks
 ┃ ┣ handlers
 ┣ pages
 ┃ ┣ GamePage
 ┃ ┣ GameResultPage
 ┃ ┣ MainPage
 ┃ ┣ NicknamePage
 ┃ ┃ ┣ NicknameInput
 ┃ ┣ ReadyPage
 ┃ ┗ RoundResultPage
 ┣ providers
 ┃ ┣ ModalProvider
 ┃ ┗ ToastProvider
 ┣ router
 ┣ styles
 ┃ ┣ utils
 ┣ types
 ┣ utils
 ┣ custom.d.ts
 ┗ index.tsx

Reference 🔎

https://www.robinwieruch.de/react-folder-structure/

@rbgksqkr rbgksqkr added ♻️ refactor 리팩토링 🫧 FE front end labels Sep 20, 2024
@rbgksqkr rbgksqkr added this to the FE Sprint5 milestone Sep 20, 2024
@rbgksqkr rbgksqkr removed this from the FE Sprint5 milestone Nov 9, 2024
@rbgksqkr rbgksqkr linked a pull request Nov 9, 2024 that will close this issue
5 tasks
rbgksqkr added a commit that referenced this issue Nov 11, 2024
[REFACTOR] 리액트 폴더 구조 개선 (pages/components)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🫧 FE front end ♻️ refactor 리팩토링
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant