Skip to content

fix: 이벤트 카드 오류 해결#210

Merged
xaexunxang merged 8 commits intodevelopfrom
fix/#207/event-create-card
Jul 3, 2025
Merged

fix: 이벤트 카드 오류 해결#210
xaexunxang merged 8 commits intodevelopfrom
fix/#207/event-create-card

Conversation

@xaexunxang
Copy link
Copy Markdown
Contributor

@xaexunxang xaexunxang commented Jul 3, 2025

해시태그 캐러셀 도입

image image
  • 호버할 때만 화살표 버튼이 보이도록 구현
  • 가장 왼쪽에 있을 때는 오른쪽 화살표만 보임
  • 가장 오른쪽에 있을 때는 왼쪽 화살표만 보임

삭제한 이벤트에 따른 티켓 상태값 동기화

image

삭제 및 종료된 이벤트에 대한 티켓 블락처리

image

Summary by CodeRabbit

  • New Features

    • 해시태그를 가로로 스크롤할 수 있는 해시태그 캐러셀 컴포넌트가 추가되었습니다.
    • 이벤트 종료 또는 삭제 시 안내 모달이 표시됩니다.
    • 텍스트 모달 컴포넌트가 새롭게 추가되었습니다.
  • Enhancements

    • 티켓, 이벤트, 카운트다운 등 주요 컴포넌트에 이벤트 상태(진행중, 종료, 삭제) 표시 및 처리 기능이 추가되었습니다.
    • 아이콘 버튼에 커스텀 CSS 클래스 적용이 가능해졌습니다.
    • 이벤트 슬라이더 내비게이션 버튼의 위치 지정이 개선되었습니다.
    • 이벤트 태그 섹션이 그리드 레이아웃으로 개선되었습니다.
  • Style

    • Tailwind에 이벤트 종료 관련 색상 토큰이 추가되었습니다.
  • Dependencies

    • classnames, react-virtuoso 패키지가 새로 추가되었습니다.

@xaexunxang xaexunxang requested a review from Yejiin21 July 3, 2025 14:28
@xaexunxang xaexunxang self-assigned this Jul 3, 2025
@xaexunxang xaexunxang added the 🛠️ BugFix 오류 해결 과정 기록 label Jul 3, 2025
@xaexunxang xaexunxang linked an issue Jul 3, 2025 that may be closed by this pull request
4 tasks
@xaexunxang xaexunxang added the 🪄 Refactoring 코드 리팩토링 label Jul 3, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 3, 2025

"""

Walkthrough

이 변경 사항은 여러 UI 컴포넌트에 새로운 상태 및 스타일 속성을 추가하고, 해시태그 캐러셀 및 텍스트 모달 등 신규 컴포넌트를 도입합니다. 이벤트 상태 관리가 세분화되고, 버튼 및 레이아웃 스타일링이 확장되었으며, 패키지 의존성과 Tailwind 색상 토큰이 추가되었습니다.

Changes

파일/경로 요약 변경 내용 요약
design-system/ui/buttons/IconButton.tsx IconButtonPropsclassName 속성 추가, 컴포넌트가 외부 CSS 클래스 허용하도록 수정
design-system/ui/texts/Countdown.tsx status prop 도입, 상태 기반 스타일 및 텍스트 분기 로직으로 리팩토링
package.json classnames, react-virtuoso 패키지 의존성 추가
src/features/home/ui/EventSliderSection.tsx IconButton에 위치 지정 클래스 부여(좌/우 버튼)
src/features/home/ui/EventTags.tsx EventSliderSection들을 그리드 래퍼(div)로 감싸 레이아웃 개선
src/features/ticket/model/Order.ts event 객체에 endDate, status 필드 추가 및 속성 순서 조정
src/pages/menu/ui/MyTicketPage.tsx 이벤트 종료/삭제 상태 시 알림용 TextModal 추가, QR 모달 노출 조건 분기
src/shared/ui/EventCard.tsx status prop 추가, 해시태그 렌더링을 HashtagCarousel로 교체
src/shared/ui/HashtagCarousel.tsx 해시태그 수평 스크롤 캐러셀 신규 컴포넌트 도입
src/shared/ui/TextModal.tsx 텍스트 알림 모달 신규 컴포넌트 도입
tailwind.config.js eventEndText, eventEndBg 색상 토큰 추가
src/shared/types/api/http-client.ts axios.post 호출 포맷팅 변경, 기능상 변화 없음

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MyTicketPage
  participant EventCard
  participant TextModal
  participant QRModal

  User->>MyTicketPage: 티켓 클릭
  MyTicketPage->>EventCard: 선택 티켓 전달 (status 포함)
  MyTicketPage->>MyTicketPage: 티켓 상태 검사
  alt status == COMPLETE or DELETED
    MyTicketPage->>TextModal: 알림 모달 오픈
    User->>TextModal: 확인 버튼 클릭
    TextModal->>MyTicketPage: 모달 닫기
  else status == PROGRESS
    MyTicketPage->>QRModal: QR 모달 오픈
  end
Loading

Possibly related PRs

Suggested labels

💖 Style

Suggested reviewers

  • hyeeuncho
  • Yejiin21

Poem

🐇
새로운 색상, 캐러셀, 모달이 춤을 추네
버튼엔 className, 이벤트엔 status도 생겼지
해시태그는 스르륵, 캐러셀로 굴러가고
종료된 이벤트엔 모달이 살포시 인사해
토끼는 깡총, 코드도 깔끔—오늘도 한 뼘 성장!

"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef7096d and 81ef54a.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • design-system/ui/buttons/IconButton.tsx (1 hunks)
  • design-system/ui/texts/Countdown.tsx (1 hunks)
  • package.json (2 hunks)
  • src/features/home/ui/EventSliderSection.tsx (1 hunks)
  • src/features/home/ui/EventTags.tsx (1 hunks)
  • src/features/ticket/model/Order.ts (1 hunks)
  • src/pages/menu/ui/MyTicketPage.tsx (6 hunks)
  • src/shared/types/api/http-client.ts (1 hunks)
  • src/shared/ui/EventCard.tsx (5 hunks)
  • src/shared/ui/HashtagCarousel.tsx (1 hunks)
  • src/shared/ui/TextModal.tsx (1 hunks)
  • tailwind.config.js (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/shared/types/api/http-client.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • package.json
  • src/features/home/ui/EventTags.tsx
  • src/features/home/ui/EventSliderSection.tsx
  • src/shared/ui/TextModal.tsx
  • tailwind.config.js
  • src/features/ticket/model/Order.ts
  • design-system/ui/buttons/IconButton.tsx
  • src/shared/ui/EventCard.tsx
  • src/shared/ui/HashtagCarousel.tsx
  • src/pages/menu/ui/MyTicketPage.tsx
  • design-system/ui/texts/Countdown.tsx
✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 3, 2025

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (7)
src/shared/ui/TextModal.tsx (3)

16-16: 하드코딩된 색상 값을 Tailwind 클래스로 개선하세요.

직접적인 RGB 값 rgb(255,117,119)보다는 Tailwind의 일관된 색상 시스템을 사용하는 것이 좋습니다.

-className="mt-2 px-4 py-1 bg-gradient-to-br from-[#FF5593] to-[rgb(255,117,119)] text-white rounded"
+className="mt-2 px-4 py-1 bg-gradient-to-br from-pink-500 to-pink-400 text-white rounded"

19-19: 하드코딩된 텍스트를 props로 받도록 개선하세요.

국제화(i18n) 지원과 재사용성을 위해 버튼 텍스트를 props로 받는 것이 좋습니다.

interface TextModalProps {
  isOpen: boolean;
  children: React.ReactNode;
  onClick: () => void;
+  confirmText?: string;
}

-const TextModal = ({ isOpen, children, onClick }: TextModalProps) => {
+const TextModal = ({ isOpen, children, onClick, confirmText = '확인' }: TextModalProps) => {
-확인
+{confirmText}

12-22: 접근성 향상을 위한 개선 사항을 고려하세요.

키보드 네비게이션과 스크린 리더 지원을 위해 접근성 속성을 추가하는 것이 좋습니다.

-<div className="fixed inset-0 z-50 bg-black bg-opacity-50 flex items-center justify-center">
+<div 
+  className="fixed inset-0 z-50 bg-black bg-opacity-50 flex items-center justify-center"
+  role="dialog"
+  aria-modal="true"
+  onClick={onClick}
+>
   <div className="flex flex-col items-center gap-4 bg-white rounded-lg p-6 min-w-[200px] text-center">
     {children}
     <button
       className="mt-2 px-4 py-1 bg-gradient-to-br from-[#FF5593] to-[rgb(255,117,119)] text-white rounded"
       onClick={onClick}
+      autoFocus
     >
       확인
     </button>
   </div>
 </div>
src/pages/menu/ui/MyTicketPage.tsx (1)

91-91: 프로덕션 코드에서 console.log를 제거하세요.

디버그용 console.log가 남아있습니다. 프로덕션 환경에서는 제거해야 합니다.

-console.log('isDoneEventModalOpen', isDoneEventModalOpen);
src/shared/ui/HashtagCarousel.tsx (1)

51-51: 프로덕션 코드에서 console.log를 제거하세요.

디버그용 console.log가 남아있습니다. 프로덕션 환경에서는 제거해야 합니다.

-console.log('hashtagSlides', hashtagSlides);
design-system/ui/texts/Countdown.tsx (2)

17-44: getStyles 함수 로직 개선 제안

현재 구현은 기능적으로 올바르지만, 몇 가지 개선 사항을 제안합니다:

  1. 코드 중복 제거: 기본 스타일과 PROGRESS 케이스의 스타일이 동일합니다.
  2. 일관성 향상: 폴백 로직에서 isCheckedisEnded 조건을 모두 고려하는 것이 의도된 동작인지 확인이 필요합니다.

다음과 같이 리팩토링을 고려해보세요:

  const getStyles = () => {
    if (status) {
      switch (status) {
        case 'PROGRESS':
-          return `
-            border-deDayText text-deDayText bg-deDayBg
-          `;
+          return `border-deDayText text-deDayText bg-deDayBg`;
        case 'COMPLETE':
-          return `
-            border-eventEndText text-eventEndText bg-eventEndBg
-          `;
+          return `border-eventEndText text-eventEndText bg-eventEndBg`;
        case 'DELETED':
-          return `
-            border-deDayTextDark text-deDayTextDark bg-deDayBgLight
-          `;
+          return `border-deDayTextDark text-deDayTextDark bg-deDayBgLight`;
        default:
-          return `
-            border-deDayText text-deDayText bg-deDayBg
-          `;
+          return `border-deDayText text-deDayText bg-deDayBg`;
      }
    }
    
    const isEnded = children === 'false';
    return isChecked && !isEnded
      ? `border-deDayText text-deDayText bg-deDayBg`
      : `border-deDayTextDark text-deDayTextDark bg-deDayBgLight`;
  };

68-68: 버튼 렌더링 개선

현재 구현은 올바르지만, 가독성을 위해 약간의 개선을 제안합니다.

- return <button className={`${baseStyles} ${getStyles()}`}>{displayText}</button>
+ return (
+   <button className={`${baseStyles} ${getStyles()}`}>
+     {displayText}
+   </button>
+ );
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between edf2eaa and 9d5adf8.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (11)
  • design-system/ui/buttons/IconButton.tsx (1 hunks)
  • design-system/ui/texts/Countdown.tsx (1 hunks)
  • package.json (2 hunks)
  • src/features/home/ui/EventSliderSection.tsx (1 hunks)
  • src/features/home/ui/EventTags.tsx (1 hunks)
  • src/features/ticket/model/Order.ts (1 hunks)
  • src/pages/menu/ui/MyTicketPage.tsx (6 hunks)
  • src/shared/ui/EventCard.tsx (5 hunks)
  • src/shared/ui/HashtagCarousel.tsx (1 hunks)
  • src/shared/ui/TextModal.tsx (1 hunks)
  • tailwind.config.js (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/features/ticket/model/Order.ts (1)
src/shared/types/baseEventType.ts (1)
  • OnlineType (1-1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: storybook
🔇 Additional comments (18)
package.json (1)

23-23: 보안 취약점 확인을 위한 추가 작업 필요

  • classnames@2.5.1react-virtuoso@4.13.0 버전은 각각 최신 버전으로 확인되었습니다.
  • 그러나 npm audit 실행 시 lockfile(package-lock.json 또는 npm-shrinkwrap.json)이 없어 보안 점검이 불가능했습니다.

수행할 작업:

  1. 프로젝트 루트에서 lockfile을 생성합니다.
    npm i --package-lock-only
  2. 생성된 lockfile을 기반으로 보안 점검을 실행합니다.
    npm audit --audit-level=moderate
  3. 취약점 결과가 있을 경우 적절히 업데이트하거나 패치하세요.
design-system/ui/buttons/IconButton.tsx (1)

8-8: className 속성 추가가 잘 구현되었습니다.

IconButton 컴포넌트에 선택적 className 속성을 추가하여 외부에서 스타일링할 수 있게 한 것은 좋은 개선입니다. 타입 정의와 구현이 올바르게 되어 있습니다.

Also applies to: 11-11, 19-19

src/features/home/ui/EventTags.tsx (1)

11-15: 그리드 레이아웃 구조가 적절하게 개선되었습니다.

EventSliderSection 컴포넌트들을 그리드 컨테이너로 감싸고 일관된 간격을 적용한 것은 좋은 개선입니다. 단일 열 레이아웃과 적절한 간격 설정이 잘 되어 있습니다.

tailwind.config.js (1)

77-78: 이벤트 종료 상태를 위한 색상 토큰이 적절하게 추가되었습니다.

eventEndTexteventEndBg 색상 토큰이 명확한 네이밍과 적절한 색상 값으로 잘 정의되었습니다. 이벤트 상태별 UI 구분을 위한 좋은 접근방식입니다.

src/features/ticket/model/Order.ts (1)

17-22: 인터페이스 업데이트가 올바르게 구현되었습니다.

새로운 statusendDate 필드가 적절히 추가되었고, 타입 정의가 명확합니다. 이벤트 상태 관리 기능 구현에 필요한 변경사항이 잘 반영되었습니다.

src/shared/ui/EventCard.tsx (3)

29-29: 상태 관리를 위한 새로운 props가 올바르게 추가되었습니다.

이벤트 상태를 나타내는 status prop이 적절히 타입 정의되어 추가되었습니다.


75-75: Countdown 컴포넌트에 status가 올바르게 전달되었습니다.

새로운 status prop이 하위 컴포넌트로 적절히 전달되어 이벤트 상태에 따른 UI 처리가 가능합니다.


98-98: HashtagCarousel 컴포넌트 사용이 올바르게 구현되었습니다.

기존 인라인 해시태그 렌더링을 새로운 캐러셀 컴포넌트로 대체하여 UI 일관성과 재사용성이 향상되었습니다.

src/pages/menu/ui/MyTicketPage.tsx (3)

79-89: 이벤트 상태 처리 로직이 올바르게 구현되었습니다.

COMPLETE와 DELETED 상태의 이벤트에 대해 적절한 메시지를 표시하는 로직이 잘 구현되었습니다.


158-158: 조건부 렌더링 로직이 올바르게 구현되었습니다.

삭제되거나 완료된 이벤트에 대해 QR 모달을 표시하지 않는 조건부 렌더링이 적절히 구현되었습니다.


179-184: TextModal 통합이 올바르게 구현되었습니다.

새로운 TextModal 컴포넌트가 이벤트 상태에 따라 적절히 표시되도록 구현되었습니다.

src/shared/ui/HashtagCarousel.tsx (5)

17-17: Math.ceil 사용이 올바르게 구현되었습니다.

스크롤 끝 지점 계산에서 부동소수점 오차를 고려한 Math.ceil 사용이 적절합니다.


56-62: 호버 시 화살표 표시 기능이 올바르게 구현되었습니다.

PR 목표에 명시된 대로 호버 시에만 화살표가 표시되고, 스크롤 위치에 따라 조건부로 렌더링되는 기능이 잘 구현되었습니다.

Also applies to: 80-87


21-31: 이벤트 리스너 정리가 올바르게 구현되었습니다.

useEffect에서 이벤트 리스너를 적절히 등록하고 정리하는 패턴이 메모리 누수를 방지합니다.


66-67: 스크롤 스냅 기능이 올바르게 구현되었습니다.

CSS scroll-snap 속성을 사용하여 부드러운 스크롤 경험을 제공하는 것이 좋습니다.


69-69: 안전한 배열 처리가 구현되었습니다.

hashtagSlides ?? []를 사용하여 undefined 값에 대한 안전한 처리가 구현되었습니다.

design-system/ui/texts/Countdown.tsx (2)

7-7: 새로운 status 프로퍼티 추가 승인

이벤트 상태를 더 세밀하게 관리할 수 있도록 하는 status 프로퍼티의 추가가 적절합니다. 타입 정의도 명확하고 optional로 설정되어 기존 코드와의 호환성을 유지합니다.


47-66: 디스플레이 로직은 완료 여부만 반영하고, isChecked는 스타일에만 적용됩니다
현재 구현은 status가 없을 때 children === 'false'일 경우에만 텍스트를 "종료"로 바꾸고, 그 외에는 남은 일수(children)를 항상 표시하도록 설계되어 있습니다. 반면 isChecked는 오직 getStyles()에서 활성/비활성 스타일을 제어하는 데만 사용되므로, 디스플레이 텍스트 로직을 isChecked까지 고려하도록 변경할 필요는 없습니다.

Likely an incorrect or invalid review comment.

Copy link
Copy Markdown
Contributor

@Yejiin21 Yejiin21 left a comment

Choose a reason for hiding this comment

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

에러 해결하느라 고생하셨습니다!
코드래빗 리뷰 반영 후 리베이스 해주세요:)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 3, 2025

@xaexunxang
Copy link
Copy Markdown
Contributor Author

Finally!

xaexunxang and others added 8 commits July 3, 2025 23:54
# 제목을 아랫줄에 작성, 제목 끝에 마침표 금지, 무엇을 했는지 명확하게 작성
fix: API 호출 URL 제거 및 불필요한 콘솔 제거
################
# 본문(추가 설명)을 아랫줄에 작성

################
# 꼬릿말(footer)을 아랫줄에 작성 (관련된 이슈 번호 등 추가)

################
# feat: 새로운 기능 추가
# fix: 버그 수정
# docs: 문서 수정
# test: 테스트 코드, 리팩토링 테스트 코드 추가
# refact: 코드 리팩토링
# style: 코드 formatting, 세미콜론 누락, 코드 자체의 변경이 없는 경우
# chore: 패키지 매니저 수정, 그 외 기타 수정 ex) .gitignore
# design: CSS 등 사용자 UI 디자인 변경
# comment: 필요한 주석 추가 및 변경
# rename: 파일 또는 폴더 명을 수정하거나 옮기는 작업만인 경우
# remove: 파일을 삭제하는 작업만 수행한 경우
# !BREAKING CHANGE: 커다란 API 변경의 이유
# !HOTFIX: 급하게 치명적인 버그를 고쳐야 하는 경우

################
@xaexunxang xaexunxang force-pushed the fix/#207/event-create-card branch from ef7096d to 81ef54a Compare July 3, 2025 15:00
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 3, 2025

@xaexunxang xaexunxang merged commit 328e896 into develop Jul 3, 2025
2 checks passed
@xaexunxang xaexunxang deleted the fix/#207/event-create-card branch July 3, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ BugFix 오류 해결 과정 기록 🪄 Refactoring 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] 이벤트 생성 및 이벤트 카드 오류 해결

2 participants