-
Notifications
You must be signed in to change notification settings - Fork 3
Feat/153/detail page loading #155
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
Conversation
|
Important Review skippedReview was skipped due to path filters β Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the Walkthroughμ΄ λ³κ²½ μ¬νμ Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
πstorybook: https://67206cc6ff9d7a05a3528ff8-rhhvsrozpy.chromatic.com/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
π§Ή Outside diff range and nitpick comments (6)
src/components/common/skeleton/gathering-skeleton-list/index.tsx (1)
Line range hint
13-16: Array μμ± μ΅μ νλ₯Ό κ³ λ €ν΄λ³΄μΈμνμ¬ κ΅¬νμ μλνμ§λ§, μ±λ₯ μ΅μ νλ₯Ό μν΄ λ€μκ³Ό κ°μ λ°©λ²μ μ μν©λλ€:
- {[...Array(num)].map((_, index) => ( + {Array.from({ length: num }).map((_, index) => (
Array.from()μ μ¬μ©νλ©΄ λ λͺ μμ μ΄κ³ λ©λͺ¨λ¦¬ ν¨μ¨μ μΈ λ°©μμΌλ‘ λ°°μ΄μ μμ±ν μ μμ΅λλ€.src/components/common/skeleton/gathering-skeleton/index.tsx (2)
5-5: λ°μν λμ΄ μ μ©μ κ³ λ €ν΄λ³΄μΈμ.νμ¬ κ³ μ λ λμ΄(
h-[380px])λ₯Ό μ¬μ©νκ³ μλλ°, λ€μν νλ©΄ ν¬κΈ°μμ λ μμ°μ€λ¬μ΄ ννμ μν΄ λ°μν λμ΄λ₯Ό μ μ©νλ κ²μ΄ μ’μ κ² κ°μ΅λλ€.-<div className="relative h-[380px] w-full overflow-hidden rounded-lg bg-white shadow-sm"> +<div className="relative min-h-[380px] h-auto w-full overflow-hidden rounded-lg bg-white shadow-sm">
7-7: μ€μΌλ ν€ UIμ aria-label μΆκ°λ₯Ό κΆμ₯λ립λλ€.λ‘λ© μνμμ μ€ν¬λ¦° 리λ μ¬μ©μμκ²λ μλ €μ£ΌκΈ° μν΄ κ° Skeleton μ»΄ν¬λνΈμ aria-labelμ μΆκ°νλ©΄ μ’μ κ² κ°μ΅λλ€.
-<Skeleton className="h-full w-full rounded-t-lg" /> +<Skeleton className="h-full w-full rounded-t-lg" aria-label="λͺ¨μ μ΄λ―Έμ§ λ‘λ© μ€" /> -<Skeleton className="mb-2 h-6 w-1/3" /> -<Skeleton className="mb-4 h-6 w-2/3" /> -<Skeleton className="h-4 w-1/2" /> +<Skeleton className="mb-2 h-6 w-1/3" aria-label="λͺ¨μ μ λͺ© λ‘λ© μ€" /> +<Skeleton className="mb-4 h-6 w-2/3" aria-label="λͺ¨μ μ€λͺ λ‘λ© μ€" /> +<Skeleton className="h-4 w-1/2" aria-label="λͺ¨μ μ 보 λ‘λ© μ€" /> -<Skeleton className="h-4 w-1/3" /> +<Skeleton className="h-4 w-1/3" aria-label="λͺ¨μ μν λ‘λ© μ€" />Also applies to: 11-13, 16-16
src/app/(crew)/crew/detail/[id]/_components/gathering-list-section.tsx (2)
27-27: μλ¬ λ©μμ§λ₯Ό λ λͺ ννκ² κ°μ ν΄λ³΄λ©΄ μ’μ κ² κ°μ΅λλ€.νμ¬ μλ¬ λ©μμ§κ° λ€μ κ°λ¨ν©λλ€. μ¬μ©μμκ² λ ꡬ체μ μΈ μλ΄λ ν΄κ²° λ°©λ²μ μ μνλ©΄ μ’μ κ² κ°μ΅λλ€.
- toast.error(`μ°νκΈ°μ μ€ν¨νμ΅λλ€`); + toast.error(`μ°νκΈ°μ μ€ν¨νμ΅λλ€. μ μ ν λ€μ μλν΄ μ£ΌμΈμ.`); - toast.error(`μ°νκΈ° ν΄μ μ μ€ν¨νμ΅λλ€`); + toast.error(`μ°νκΈ° ν΄μ μ μ€ν¨νμ΅λλ€. μ μ ν λ€μ μλν΄ μ£ΌμΈμ.`);Also applies to: 37-37
68-71: λΉ μν UIκ° μ¬μ©μ μΉνμ μΌλ‘ κ°μ λμμ΅λλ€.λΉ μνλ₯Ό λ¨μν "λ°μ΄ν° μμ"μΌλ‘ νμνλ λμ , μ¬μ©μμκ² νλμ μ λνλ λ©μμ§λ₯Ό μΆκ°ν κ²μ΄ μ’μ κ°μ μ λλ€.
λ€λ§, μ κ·Όμ± ν₯μμ μν΄ μ΄λͺ¨μ§μ aria-labelμ μΆκ°νλ©΄ μ’μ κ² κ°μ΅λλ€.
- <p className="mt-2 text-base font-medium text-blue-400">μλ‘μ΄ μ½μμ λ§λ€μ΄λ³΄μΈμ! π</p> + <p className="mt-2 text-base font-medium text-blue-400">μλ‘μ΄ μ½μμ λ§λ€μ΄λ³΄μΈμ! <span role="img" aria-label="νμ">π</span></p>src/app/(crew)/crew/detail/[id]/_components/detail-crew-container.tsx (1)
42-42: λ°μ΄ν° μ²λ¦¬κ° μ΅μ νλμμ΅λλ€.μ°Έκ°μ μ νμΈ λ‘μ§μ΄ κ°λ¨νκ² κ°μ λμμ΅λλ€. κ°λ μ±μ μν΄ λ³μλͺ μ λ λͺ ννκ² μ§μ μ μμ΅λλ€.
-setIsConfirmed(data.participantCount === data.totalCount); +setIsConfirmed(data.currentParticipants === data.maxParticipants);
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
π Files selected for processing (5)
src/app/(crew)/crew/detail/[id]/_components/detail-crew-container.tsx(3 hunks)src/app/(crew)/crew/detail/[id]/_components/gathering-list-section.tsx(5 hunks)src/components/common/skeleton/crew-detail-skeleton/index.tsx(1 hunks)src/components/common/skeleton/gathering-skeleton-list/index.tsx(1 hunks)src/components/common/skeleton/gathering-skeleton/index.tsx(1 hunks)
β Files skipped from review due to trivial changes (1)
- src/components/common/skeleton/crew-detail-skeleton/index.tsx
π Additional comments (5)
src/components/common/skeleton/gathering-skeleton-list/index.tsx (1)
10-10: λ°μν λμμΈ κ°μ μ΄ μ μ΄λ£¨μ΄μ‘μ΅λλ€!
className μμ±μ λ³κ²½μ¬νμ΄ λ€μκ³Ό κ°μ μ΄μ μ μ 곡ν©λλ€:
w-fullλ‘ μ»¨ν μ΄λ λλΉλ₯Ό μ΅λν νμ©- ν° νλ©΄μμ
lg:max-w-[1200px]λ‘ μ μ ν μ΅λ λλΉ μ ν - λ°μν 그리λ λ μ΄μμ μ μ§
src/components/common/skeleton/gathering-skeleton/index.tsx (1)
5-18: μ€μΌλ ν€ UI κ΅¬μ‘°κ° μ ꡬνλμμ΅λλ€!
μ»΄ν¬λνΈμ ꡬ쑰μ μ€νμΌλ§μ΄ κΉλνκ² μ 리λμ΄ μμ΅λλ€. μ€μ 컨ν μΈ μ λ μ΄μμμ μ λ°μνκ³ μμ΄ μμ°μ€λ¬μ΄ λ‘λ© μνλ₯Ό ννν μ μμ΅λλ€.
src/app/(crew)/crew/detail/[id]/_components/gathering-list-section.tsx (1)
10-10: μ€μΌλ ν€ UI ꡬνμ΄ μ μ ν μ΄λ£¨μ΄μ‘μ΅λλ€.
κΈ°μ‘΄ Loader μ»΄ν¬λνΈλ₯Ό GatheringSkeletonListλ‘ κ΅μ²΄ν κ²μ μ¬μ©μ κ²½ν ν₯μμ λμμ΄ λ κ²μΌλ‘ 보μ λλ€.
Also applies to: 54-54
src/app/(crew)/crew/detail/[id]/_components/detail-crew-container.tsx (2)
11-13: μ»΄ν¬λνΈ μμ‘΄μ±μ΄ μ μ ν μΆκ°λμμ΅λλ€.
μλ‘μ΄ μ€μΌλ ν€ UIμ μλ¬ μ²λ¦¬λ₯Ό μν μ»΄ν¬λνΈλ€μ΄ μ μν¬νΈλμμ΅λλ€.
115-115: μ€μΌλ ν€ UI μ μ©μ΄ μ λμμ΅λλ€.
μΌλ° λ‘λ λμ μμΈ νμ΄μ§μ νΉνλ μ€μΌλ ν€ UIλ₯Ό μ¬μ©νμ¬ μ¬μ©μ κ²½νμ΄ κ°μ λμμ΅λλ€.
| const renderErrorState = (message: string, actionLabel: string, action: () => void) => ( | ||
| <div className="flex h-screen flex-col items-center justify-center"> | ||
| <p className="mb-4 text-gray-500">{message} π</p> | ||
| <Button className="btn-filled" onClick={action}> | ||
| {actionLabel} | ||
| </Button> | ||
| </div> | ||
| ); | ||
|
|
||
| if (fetchError || !data) { | ||
| if (fetchError instanceof ApiError) { | ||
| try { | ||
| const errorData = JSON.parse(fetchError.message); | ||
|
|
||
| if (errorData.status === 'NOT_FOUND') { | ||
| return <p>ν¬λ£¨ μ 보λ₯Ό μ°Ύμ μ μμ΅λλ€</p>; | ||
| } | ||
| } catch (parseError) { | ||
| return <p>{`Error ${fetchError.message}`}</p>; | ||
| if (fetchError.status === 404) { | ||
| router.push('/404'); | ||
| return null; | ||
| } | ||
| toast.error(fetchError.message || 'π« μλ¬κ° λ°μνμ΅λλ€.'); | ||
| } else if (fetchError) { | ||
| toast.error('π« λ°μ΄ν° ν΅μ μ μ€ν¨νμ΅λλ€.'); | ||
| } | ||
| return <p>λ°μ΄ν° ν΅μ μ μ€ν¨νμ΅λλ€.</p>; | ||
| } | ||
|
|
||
| if (!data) { | ||
| return <p>λ°μ΄ν°λ₯Ό λΆλ¬μ¬ μ μμ΅λλ€.</p>; | ||
| const errorMessage = fetchError | ||
| ? 'λ°μ΄ν°λ₯Ό λΆλ¬μ€λ λ° μ€ν¨νμ΅λλ€.' | ||
| : 'λ°μ΄ν°λ₯Ό λΆλ¬μ¬ μ μμ΅λλ€.'; | ||
|
|
||
| return renderErrorState(errorMessage, 'λ€μ μλ', refetch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
μλ¬ μ²λ¦¬ λ‘μ§ κ°μ μ΄ νμν©λλ€.
μλ¬ μ²λ¦¬κ° κ°μ λμμ§λ§, λ€μ μ¬νλ€μ κ³ λ €ν΄λ³΄μκΈ° λ°λλλ€:
- μλ¬ λ©μμ§λ₯Ό μμλ‘ λΆλ¦¬νμ¬ μ€μ κ΄λ¦¬
- ApiError νμ μ²΄ν¬ λ‘μ§ κ°μ
λ€μκ³Ό κ°μ΄ κ°μ ν΄λ³΄μΈμ:
+const ERROR_MESSAGES = {
+ FETCH_FAILED: 'λ°μ΄ν°λ₯Ό λΆλ¬μ€λ λ° μ€ν¨νμ΅λλ€.',
+ NO_DATA: 'λ°μ΄ν°λ₯Ό λΆλ¬μ¬ μ μμ΅λλ€.',
+ NETWORK_ERROR: 'π« λ°μ΄ν° ν΅μ μ μ€ν¨νμ΅λλ€.',
+} as const;
- if (fetchError instanceof ApiError) {
- if (fetchError.status === 404) {
+ if (fetchError instanceof ApiError && fetchError.status === 404) {
router.push('/404');
return null;
- }
- toast.error(fetchError.message || 'π« μλ¬κ° λ°μνμ΅λλ€.');
- } else if (fetchError) {
- toast.error('π« λ°μ΄ν° ν΅μ μ μ€ν¨νμ΅λλ€.');
}
+
+ const errorMessage = fetchError instanceof ApiError
+ ? fetchError.message
+ : ERROR_MESSAGES.NETWORK_ERROR;
+
+ toast.error(errorMessage);π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const renderErrorState = (message: string, actionLabel: string, action: () => void) => ( | |
| <div className="flex h-screen flex-col items-center justify-center"> | |
| <p className="mb-4 text-gray-500">{message} π</p> | |
| <Button className="btn-filled" onClick={action}> | |
| {actionLabel} | |
| </Button> | |
| </div> | |
| ); | |
| if (fetchError || !data) { | |
| if (fetchError instanceof ApiError) { | |
| try { | |
| const errorData = JSON.parse(fetchError.message); | |
| if (errorData.status === 'NOT_FOUND') { | |
| return <p>ν¬λ£¨ μ 보λ₯Ό μ°Ύμ μ μμ΅λλ€</p>; | |
| } | |
| } catch (parseError) { | |
| return <p>{`Error ${fetchError.message}`}</p>; | |
| if (fetchError.status === 404) { | |
| router.push('/404'); | |
| return null; | |
| } | |
| toast.error(fetchError.message || 'π« μλ¬κ° λ°μνμ΅λλ€.'); | |
| } else if (fetchError) { | |
| toast.error('π« λ°μ΄ν° ν΅μ μ μ€ν¨νμ΅λλ€.'); | |
| } | |
| return <p>λ°μ΄ν° ν΅μ μ μ€ν¨νμ΅λλ€.</p>; | |
| } | |
| if (!data) { | |
| return <p>λ°μ΄ν°λ₯Ό λΆλ¬μ¬ μ μμ΅λλ€.</p>; | |
| const errorMessage = fetchError | |
| ? 'λ°μ΄ν°λ₯Ό λΆλ¬μ€λ λ° μ€ν¨νμ΅λλ€.' | |
| : 'λ°μ΄ν°λ₯Ό λΆλ¬μ¬ μ μμ΅λλ€.'; | |
| return renderErrorState(errorMessage, 'λ€μ μλ', refetch); | |
| const ERROR_MESSAGES = { | |
| FETCH_FAILED: 'λ°μ΄ν°λ₯Ό λΆλ¬μ€λ λ° μ€ν¨νμ΅λλ€.', | |
| NO_DATA: 'λ°μ΄ν°λ₯Ό λΆλ¬μ¬ μ μμ΅λλ€.', | |
| NETWORK_ERROR: 'π« λ°μ΄ν° ν΅μ μ μ€ν¨νμ΅λλ€.', | |
| } as const; | |
| const renderErrorState = (message: string, actionLabel: string, action: () => void) => ( | |
| <div className="flex h-screen flex-col items-center justify-center"> | |
| <p className="mb-4 text-gray-500">{message} π</p> | |
| <Button className="btn-filled" onClick={action}> | |
| {actionLabel} | |
| </Button> | |
| </div> | |
| ); | |
| if (fetchError || !data) { | |
| if (fetchError instanceof ApiError && fetchError.status === 404) { | |
| router.push('/404'); | |
| return null; | |
| } | |
| const errorMessage = fetchError instanceof ApiError | |
| ? fetchError.message | |
| : ERROR_MESSAGES.NETWORK_ERROR; | |
| toast.error(errorMessage); | |
| const errorMessage = fetchError | |
| ? 'λ°μ΄ν°λ₯Ό λΆλ¬μ€λ λ° μ€ν¨νμ΅λλ€.' | |
| : 'λ°μ΄ν°λ₯Ό λΆλ¬μ¬ μ μμ΅λλ€.'; | |
| return renderErrorState(errorMessage, 'λ€μ μλ', refetch); |
yulrang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μκ³ νμ ¨μ΅λλ€!!!! π
|
πstorybook: https://67206cc6ff9d7a05a3528ff8-yjlmqkrnyc.chromatic.com/ |
minkyung5x5
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μκ³ νμ ¨μ΅λλ€-!!
|
πstorybook: https://67206cc6ff9d7a05a3528ff8-fdvsiqylpt.chromatic.com/ |
π Issue Ticket
#153
βοΈ Description
λν μΌ νμ΄μ§ μ€μΌλ ν€ ui μ μ©, 404νμ΄μ§ μ΄λ
β Checklist
PR
Test
Summary by CodeRabbit
μλ‘μ΄ κΈ°λ₯
CrewDetailSkeletonλ°GatheringSkeletonListλ₯Ό ν΅ν λ‘λ© μν κ°μ .λ²κ·Έ μμ
μ€νμΌ