Skip to content

refact: 이벤트 생성 페이지 리펙토링#181

Merged
xaexunxang merged 3 commits intodevelopfrom
refact/#179/event-create-refactoring
Jun 17, 2025
Merged

refact: 이벤트 생성 페이지 리펙토링#181
xaexunxang merged 3 commits intodevelopfrom
refact/#179/event-create-refactoring

Conversation

@xaexunxang
Copy link
Copy Markdown
Contributor

@xaexunxang xaexunxang commented Jun 17, 2025

날짜 선택 중 날짜에 키보드 입력 제한 및 커서 비활성화

image

이벤트 오프라인 위치 좌표 설정 (서울 시청)

image

이벤트 등록 홈버튼 제거 및 첫 페이지에서 홈버튼만 렌더링

image

기타 사항 (노션 참고)

  1. 날짜 선택 시 텍스트 박스 간 간격에 변화
  2. 이벤트 생성 과정에서 뒤로가기
  3. 뒤로가기 무한 호스트 생성은 이벤트 등록 홈버튼 제거 및 첫 페이지에서 홈버튼만 렌더링 테스크 진행하면서 해결됌

Summary by CodeRabbit

  • 신규 기능
    • 이벤트 등록 레이아웃에서 홈 아이콘 버튼을 통한 홈 이동 기능이 추가되었습니다.
  • 버그 수정
    • 날짜 및 시간 선택 입력란에서 직접 입력이 비활성화되고, 클릭 가능한 UI로 개선되었습니다.
  • 스타일
    • 날짜 및 시간 선택기의 커서 및 캐럿(텍스트 커서) 스타일이 개선되었습니다.
  • 리팩터
    • Header 컴포넌트의 버튼 렌더링 로직이 개선되었습니다.
  • 기타
    • 이벤트 생성 시 기본 위치 좌표가 서울(37.5665, 126.9780)로 변경되었습니다.
    • 이벤트 타입 화면에서 위치 정보가 콘솔에 출력됩니다.
    • 불필요한 CSS 파일의 공백이 제거되었습니다.

@xaexunxang xaexunxang linked an issue Jun 17, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 17, 2025

Caution

Review failed

The pull request is closed.

"""

Walkthrough

여러 UI 컴포넌트의 상호작용과 스타일이 개선되었습니다. Header 컴포넌트의 버튼 처리 로직이 확장되었고, EventRegisterLayout에 goHome 옵션이 추가되어 홈 네비게이션이 가능해졌습니다. 날짜 입력 UI와 초기 위치값, 디버깅 로그, CSS 포맷 등도 소폭 수정되었습니다.

Changes

파일/경로 요약 변경 내용 요약
design-system/ui/Header.tsx HeaderProps의 rightContent 타입 확장, isButtonElement 타입가드 추가, leftButtonLabel 렌더링 로직 개선
src/shared/ui/backgrounds/EventRegisterLayout.tsx goHome 옵션 prop 추가, goHome에 따라 헤더 좌/우 버튼 렌더링 및 클릭 동작 분기
src/features/event/model/FunnelContext.tsx eventState의 locationLat/lng 초기값을 37.5665, 126.9780으로 변경
src/features/event/ui/DatePicker.tsx DatePicker 및 select 요소에 cursor-pointer, caret-transparent 등 스타일 및 입력 제한 추가
src/features/event/ui/EventFunnel.tsx EventRegisterLayout에 goHome={true} prop 추가
src/features/event/ui/EventType.tsx eventState 위치값을 콘솔에 출력하는 로그 추가
src/index.css 파일 마지막 줄의 개행문자 제거

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EventFunnel
    participant EventRegisterLayout
    participant Header

    User->>EventFunnel: 이벤트 생성 시작
    EventFunnel->>EventRegisterLayout: goHome={true} 전달
    EventRegisterLayout->>Header: leftButtonLabel, leftButtonClick, rightContent 결정
    User->>Header: 좌측 버튼 클릭
    alt goHome이 true
        Header->>User: 홈("/")으로 이동
    else goHome이 false
        Header->>EventRegisterLayout: onPrev() 호출
    end
Loading

Possibly related PRs

Poem

🐇
버튼이 바뀌고, 홈으로 점프!
날짜엔 커서, 입력은 멈춤.
위도 경도 새로 잡고
로그로 위치도 콕콕콕!
작은 변화 모여
토끼는 오늘도 깡총깡총
코드를 다듬어요!

"""


📜 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 2ce2d3a and 063c0c0.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • design-system/ui/Header.tsx (1 hunks)
  • src/features/event/model/FunnelContext.tsx (1 hunks)
  • src/features/event/ui/DatePicker.tsx (4 hunks)
  • src/features/event/ui/EventFunnel.tsx (1 hunks)
  • src/features/event/ui/EventType.tsx (1 hunks)
  • src/index.css (1 hunks)
  • src/shared/ui/backgrounds/EventRegisterLayout.tsx (3 hunks)
✨ 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

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 (5)
src/features/event/model/FunnelContext.tsx (1)

34-35: 기본 좌표값 하드코딩은 상수/환경변수로 분리 권장

locationLat, locationLng 기본값을 서울시청 좌표로 직접 기입하면 테스트-환경 분리나 다국가 확장 시 유지보수가 어려워집니다.

-    locationLat: 37.5665,
-    locationLng: 126.9780,
+    locationLat: DEFAULT_LOCATION_LAT, // ex) 37.5665
+    locationLng: DEFAULT_LOCATION_LNG, // ex) 126.9780

상수를 별도 파일에 선언하거나 .env로 주입해 주세요.

src/features/event/ui/EventType.tsx (1)

49-49: 디버그 console.log는 제거하고 필요 시 로거로 대체하세요

console.log(eventState.locationLat, eventState.locationLng); 는 개발 단계 디버그 용도로 보입니다. 운영 코드에 남아 있으면 콘솔 오염 및 성능 저하가 발생할 수 있습니다.

-  console.log(eventState.locationLat, eventState.locationLng);
+  // DEBUG: 위치 값 확인용 로그 — 필요 시 전용 로거(util/logger.ts) 사용

커밋 단계에서 제거하거나 process.env.NODE_ENV !== 'production' 조건부로 감싸는 것을 권장합니다.

design-system/ui/Header.tsx (1)

44-48: 네이티브 버튼 외 커스텀 Button 컴포넌트는 걸러집니다

element.type === 'button' 조건은 <button> DOM 노드만 해당하므로 forwardRef로 래핑된 버튼이나 디자인 시스템의 IconButton 컴포넌트는 통과하지 못합니다. 의도라면 주석으로 명시하고, 아니라면 typeof element.type === 'function' 등 추가 체크가 필요합니다.

src/features/event/ui/EventFunnel.tsx (1)

84-85: 불린 props는 값 생략 권장

JSX 불린 속성은 존재 자체가 true를 의미합니다.

-          goHome={true}
+          goHome

불필요한 = {true}를 제거하면 코드 가독성이 향상됩니다.

src/shared/ui/backgrounds/EventRegisterLayout.tsx (1)

50-57: 이중 네비게이션 호출 가능성 – 불필요한 중복 클릭 핸들러 제거 제안

leftButtonLabel 안의 IconButtonleftButtonClick prop 모두 navigate('/') 를 호출하고 있어,
같은 프레임에서 두 번 렌더링 / push 가 발생할 수 있습니다(react-router v6 는 동일 경로 push 시 무시하지만, side-effect hook 이 있으면 문제가 될 수 있음).

불필요한 중복을 제거하여 의도를 명확히 하는 편이 좋습니다.

-leftButtonLabel={goHome ? (              
-  <IconButton
-    iconPath={<img src={HomeButton} />}
-    onClick={() => navigate('/')}
-    iconClassName="cursor-pointer z-30 ml-auto"
-  />) : '<'}
-leftButtonClick={goHome ? () => navigate('/') : onPrev}
+leftButtonLabel={
+  goHome ? <IconButton iconPath={<img src={HomeButton} />} /> : '<'
+}
+leftButtonClick={goHome ? () => navigate('/') : onPrev}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 19f3666 and 6c5c3ff.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • design-system/ui/Header.tsx (1 hunks)
  • src/features/event/model/FunnelContext.tsx (1 hunks)
  • src/features/event/ui/DatePicker.tsx (4 hunks)
  • src/features/event/ui/EventFunnel.tsx (1 hunks)
  • src/features/event/ui/EventType.tsx (1 hunks)
  • src/index.css (1 hunks)
  • src/shared/ui/backgrounds/EventRegisterLayout.tsx (3 hunks)
🧰 Additional context used
🪛 ESLint
design-system/ui/Header.tsx

[error] 19-19: Unexpected any. Specify a different type.

(@typescript-eslint/no-explicit-any)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: storybook
🔇 Additional comments (3)
src/index.css (1)

109-109: 불필요한 변경만 포함된 커밋

마지막 개행 제거 외에 실질적 변화가 없습니다. 추적용 변경이 아니라면 해당 커밋은 생략하는 편이 이력 관리에 유리합니다.

src/features/event/ui/DatePicker.tsx (1)

140-144: 스타일 개선 👍

cursor-pointer 추가로 클릭 가능함을 명확히 했고, 기존 로직에 부작용은 없습니다.
특별한 이슈 없이 머지 가능합니다.

Also applies to: 189-193

src/shared/ui/backgrounds/EventRegisterLayout.tsx (1)

60-66: 조건부 렌더링 로직 명확하여 👍

goHome 이 true 인 경우 우측 홈 버튼을 숨기는 처리와 className 유지가 잘 반영되었습니다.

@github-actions
Copy link
Copy Markdown

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.

수고하셨습니다~

@xaexunxang xaexunxang force-pushed the refact/#179/event-create-refactoring branch from 2ce2d3a to 063c0c0 Compare June 17, 2025 14:18
@github-actions
Copy link
Copy Markdown

@xaexunxang xaexunxang merged commit b67d08f into develop Jun 17, 2025
2 checks passed
@xaexunxang xaexunxang deleted the refact/#179/event-create-refactoring branch June 17, 2025 14:20
@xaexunxang xaexunxang self-assigned this Jun 17, 2025
@xaexunxang xaexunxang added the 🪄 Refactoring 코드 리팩토링 label Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪄 Refactoring 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] 이벤트 생성 페이지 리팩토링

2 participants