refactor(STUDY-308): 태블릿 화면에서 2열로 보이도록 그리드 추가#124
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Walkthrough
Changes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/pages/StudyListPage.tsx (1)
64-64:⚠️ Potential issue | 🟠 Major
sm:w-[300px]고정 너비가 새 그리드 레이아웃과 충돌합니다.
sm브레이크포인트(640px) 이상에서 카드 너비가 300px로 고정되어,md:grid-cols-2그리드 셀을 채우지 못하고 빈 공간이 생깁니다. 그리드가 카드 너비를 제어하도록sm:w-[300px]을 제거하는 것을 권장합니다.🔧 수정 제안
- className="w-full min-w-0 cursor-pointer border-gray-200 transition-shadow hover:shadow-md sm:w-[300px]" + className="w-full min-w-0 cursor-pointer border-gray-200 transition-shadow hover:shadow-md"
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/pages/StudyListPage.tsx`:
- Around line 58-61: The Card element in StudyListPage (the JSX Card with
key={study.id} and onClick={() => onViewStudyDetail(study.id)}) uses a fixed
responsive width class `sm:w-[250px]` which conflicts with the grid column
sizing; remove `sm:w-[250px]` from the Card's className so the card uses
`w-full` to fill its grid cell, and if you need to cap card width instead use
`sm:max-w-[250px]` or constrain the grid container (e.g., `max-w-screen-...`)
rather than forcing a fixed cell width.
🧹 Nitpick comments (1)
src/pages/StudyListPage.tsx (1)
66-79: 모집 상태 판별 조건이 중복되어 있습니다.Lines 69-70과 75-76에 동일한 조건(
participantCount < maxParticipants || maxParticipants === 0)이 반복됩니다. 변수로 추출하면 가독성과 유지보수성이 좋아집니다.제안된 수정
카드 렌더링 블록 상단에서 변수를 추출:
studies.map((study: StudyListItem) => { + const isRecruiting = + study.participantCount < study.maxParticipants || + study.maxParticipants === 0; + return ( <Card key={study.id} ... > <CardContent className="p-6"> <div className="space-y-3"> <div> <Badge variant="secondary" className={`${ - study.participantCount < study.maxParticipants || - study.maxParticipants === 0 + isRecruiting ? "bg-blue-100 text-blue-800" : "bg-gray-100 text-gray-800" }`} > - {study.participantCount < study.maxParticipants || - study.maxParticipants === 0 + {isRecruiting ? "모집중" : "모집완료"} </Badge> </div> ... </div> </CardContent> - </Card> + </Card>); + })
Summary by CodeRabbit
스타일
리팩터