Skip to content

Conversation

@dbstj0403
Copy link
Collaborator

@dbstj0403 dbstj0403 commented May 12, 2025

🌟 어떤 이유로 MR를 하셨나요?

  • feature 병합()
  • 버그 수정(아래에 issue #를 남겨주세요)
  • 코드 개선
  • 코드 수정
  • 배포
  • 기타(아래에 자세한 내용 기입해주세요)

📝 세부 내용 - 왜 해당 MR이 필요한지 작업 내용을 자세하게 설명해주세요

  • 영수증 리뷰시 고정값으로 하드코딩되어있던 값 동적으로 변경되도록 수정했습니다.
  • 토스트 모달 아이콘 어떻게 변경해야 하는지 몰루겠어요....
  • 영수증 리뷰 확인 창에서 기업 카테고리로 뜨도록 수정했습니다.

📸 작업 화면 스크린샷

X

⚠️ MR하기 전에 확인해주세요

  • 로컬테스트를 진행하셨나요?
  • 머지할 브랜치를 확인하셨나요?
  • 관련 label을 선택하셨나요?

Summary by CodeRabbit

  • 신규 기능
    • 여러 페이지 및 컴포넌트에 토스트 알림 시스템이 도입되어, 기존의 alert 창 대신 비차단형 토스트 메시지로 오류 및 알림을 제공합니다.
  • 버그 수정
    • 이미지 업로드 시 하드코딩된 회사 ID가 동적으로 전달된 값으로 대체되었습니다.
  • 스타일
    • 토스트 메시지의 텍스트 스타일이 개선되어 가독성이 향상되었습니다.
  • 기타
    • 카테고리 라벨 표기가 맵핑 테이블을 사용하도록 개선되었습니다.
    • 일부 네비게이션 동작이 홈으로 바로 이동하도록 변경되었습니다.
    • 불필요한 코드 및 주석이 정리되어 코드 가독성이 향상되었습니다.
    • 사용하지 않는 상태 및 메서드가 제거되어 상태 관리가 간소화되었습니다.
    • 정적 리뷰 데이터가 삭제되어 관련 컴포넌트에서 제거되었습니다.

@dbstj0403 dbstj0403 requested a review from shroqkf May 12, 2025 13:42
@dbstj0403 dbstj0403 self-assigned this May 12, 2025
@dbstj0403 dbstj0403 added the Fix Something isn't working label May 12, 2025
@vercel
Copy link

vercel bot commented May 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
morak ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 6:49am

@coderabbitai
Copy link

coderabbitai bot commented May 12, 2025

Caution

Review failed

The pull request is closed.

## Walkthrough

이 변경사항은 여러 컴포넌트에서 기존의 alert 기반 에러 알림을 ToastModal 기반의 비차단 토스트 알림으로 대체하고, 카테고리 표시 로직을 businessTypeNameMap을 활용하도록 수정하며, 불필요한 코드와 주석을 정리합니다. 내비게이션 동작 및 텍스트 스타일링도 일부 조정되었습니다.

## Changes

| 파일/경로 그룹                                                          | 변경 요약                                                                                       |
|------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| src/pages/map/components/review/ConfirmImage.jsx                       | 카테고리 표시를 businessTypeNameMap을 이용하도록 변경, 불필요한 함수 및 주석 제거, setReviewInfo 호출 정리 |
| src/pages/map/components/review/ReviewImageCapture.jsx                 | alert 기반 에러 알림을 ToastModal 토스트 알림으로 대체, companyId 동적 할당, 관련 import 및 상태 추가     |
| src/components/common/ToastModal.jsx                                   | 토스트 메시지 텍스트 스타일 클래스 변경(폰트 및 줄바꿈 처리 방식 조정)                              |
| src/pages/myPage/MyPage.jsx                                            | 로그아웃 에러 시 alert 대신 ToastModal 사용, 토스트 상태 및 fireToast 함수 추가, 불필요한 주석 제거      |
| src/pages/review/StoreReviewPage.jsx                                   | 뒤로가기 버튼 동작을 navigate(-1)에서 navigate("/")로 변경                                        |
| src/pages/support/components/step/Step6.jsx                            | 에러 알림을 alert에서 ToastModal 기반 토스트로 변경, 관련 상태 및 fireToast 함수 추가                |
| src/pages/writeReview/components/WriteText.jsx                         | 리뷰 제출 실패 시 alert 대신 ToastModal 토스트 알림 사용, 관련 상태 및 fireToast 함수 추가           |
| src/constants/review/reviewData.js                                     | 정적 리뷰 데이터 배열 export 삭제                                                                |
| src/pages/map/components/review/ReviewList.jsx                         | 사용하지 않는 reviewData import 제거                                                            |
| src/pages/story/components/carousel/BestStoryCarousel.jsx              | import 주석 제거 (스타일시트 관련)                                                               |
| src/pages/support/components/step/Step7.jsx                           | 사용하지 않는 useState import 및 불필요한 props 제거                                            |
| src/pages/writeReview/components/FireTemperatureSlider.jsx             | 사용하지 않는 useState, useEffect import 제거                                                   |
| src/pages/writeReview/components/SelectTag.jsx                         | 사용하지 않는 useEffect import 및 주석 처리된 JSX 제거, paymentStore에서 reviewInfo 삭제          |
| src/store/paymentStore.js                                               | paymentTime, receiptInfo 상태 및 관련 setter 메서드 삭제                                        |

## Possibly related PRs

- Morak-Team/Frontend#43: ConfirmImage.jsx 내 회사 카테고리 표시 및 리뷰 관련 데이터 처리와 연관된 변경사항 포함.
- Morak-Team/Frontend#38: ConfirmImage.jsx 컴포넌트에 날짜/시간 선택기 및 모달 애니메이션 추가 관련 PR.
- Morak-Team/Frontend#53: ConfirmImage.jsx의 onConfirmComplete prop 추가 및 내비게이션 로직 변경 관련 PR.

## Suggested reviewers

- shroqkf

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 c9c948d and c6b34e4.

📒 Files selected for processing (4)
  • src/pages/map/components/review/ReviewImageCapture.jsx (6 hunks)
  • src/pages/myPage/MyPage.jsx (4 hunks)
  • src/pages/support/components/step/Step6.jsx (3 hunks)
  • src/pages/writeReview/components/WriteText.jsx (4 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.

Copy link

@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: 0

🧹 Nitpick comments (1)
src/pages/map/components/review/ConfirmImage.jsx (1)

16-17: 디버깅용 console.log는 제거하는 것이 좋습니다

PR을 제출하기 전에 디버깅용 console.log를 제거하는 것이 좋은 관행입니다. 프로덕션 코드에 불필요한 로그가 남아있지 않도록 합시다.

-  console.log("data, ", data);
-
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1c93e31 and b8ca949.

📒 Files selected for processing (3)
  • src/constants/review/companyCategoryMap.js (1 hunks)
  • src/pages/map/components/review/ConfirmImage.jsx (2 hunks)
  • src/pages/map/components/review/ReviewImageCapture.jsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/pages/map/components/review/ConfirmImage.jsx (1)
src/constants/review/companyCategoryMap.js (2)
  • companyCategoryMap (1-12)
  • companyCategoryMap (1-12)
src/pages/map/components/review/ReviewImageCapture.jsx (1)
src/pages/review/StoreReviewPage.jsx (1)
  • companyId (15-15)
🔇 Additional comments (4)
src/pages/map/components/review/ReviewImageCapture.jsx (1)

171-171: 하드코딩된 companyId 값을 동적 props로 교체한 점 좋습니다!

이전에는 회사 ID가 '780'으로 하드코딩되어 있었는데, 이제 컴포넌트로 전달되는 companyId props를 사용하도록 수정되었습니다. 이는 PR의 목적인 "영수증 리뷰 companyId 고정값 수정"과 정확히 일치합니다.

src/constants/review/companyCategoryMap.js (1)

1-12: 카테고리 상수 매핑 추가가 좋은 접근입니다!

영문 카테고리 키를 한글 이름으로 매핑하는 상수 객체를 만들어 관리하는 방식은 코드 유지보수성을 높이는 좋은 방법입니다. 이렇게 하면 카테고리 표시 방식을 일관되게 유지하고 변경이 필요할 때 한 곳에서만 수정하면 됩니다.

src/pages/map/components/review/ConfirmImage.jsx (2)

12-12: companyCategoryMap 상수 import 추가 👍

새로 생성된 카테고리 매핑 상수를 import하여 사용하는 것은 좋은 접근법입니다.


235-237: 카테고리 표시 방식 개선이 잘 되었습니다!

영문 카테고리 키 대신 companyCategoryMap을 사용하여 한글 카테고리명을 표시하도록 변경한 점이 좋습니다. 사용자 경험 측면에서 더 자연스러운 표현이 가능해졌고, 없는 카테고리의 경우 "기타"로 대체하는 폴백 로직도 적절합니다.

Copy link
Collaborator

@shroqkf shroqkf left a comment

Choose a reason for hiding this comment

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

토스트 모달 컴포넌트 아이콘 변경할 때 아래처럼 하시면 됩니다

import ToastModal from "@components/common/ToastModal";
import ErrorIcon from "/public/svgs/review/errorIcon.svg?react";

const [toast, setToast] = useState({ show: false, message: "", icon: null });

<button onClick={() => {
  setToast({
    show: true,
    message: "처리 중 오류가 발생했습니다.",
    icon: ErrorIcon,
  });
}}>
  오류 발생 테스트
</button>

{toast.show && (
  <ToastModal
    message={toast.message}
    icon={toast.icon}
    onClose={() => setToast((prev) => ({ ...prev, show: false }))}
  />
)}

@dbstj0403 dbstj0403 changed the title Fix: 영수증 리뷰 companyId 고정값 수정 [Fix] 영수증 리뷰 companyId 고정값 수정 May 13, 2025
Copy link

@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: 0

🧹 Nitpick comments (2)
src/pages/writeReview/components/WriteText.jsx (2)

19-27: 토스트 상태 관리 로직 구현 적절

토스트 알림을 위한 상태 관리와 fireToast 헬퍼 함수가 잘 구현되었습니다:

  • 토스트 표시 여부, 메시지, 아이콘을 관리하는 상태 설정
  • 자동으로 토스트를 숨기는 타이머 로직
  • 기본 매개변수 값(아이콘, 지속 시간)을 활용한 유연한 함수 설계

다른 곳에서도 재사용할 수 있도록 이 로직을 별도의 커스텀 훅으로 추출하는 것을 고려해보세요:

+// src/hooks/useToast.js
+import { useState } from "react";
+import ErrorIcon from "/public/svgs/modal/errorIcon.svg?react";
+
+export const useToast = () => {
+  const [toast, setToast] = useState({
+    show: false,
+    message: "",
+    icon: null,
+    duration: 4000,
+  });
+
+  const fireToast = (message, icon = ErrorIcon, duration = 4000) => {
+    setToast({ show: true, message, icon, duration });
+    setTimeout(() => setToast((t) => ({ ...t, show: false })), duration);
+  };
+
+  return { toast, fireToast, setToast };
+};

108-115: 토스트 모달 컴포넌트 조건부 렌더링 구현

토스트 모달을 조건부로 렌더링하고 필요한 props를 전달하는 방식이 잘 구현되었습니다.

토스트 상태에 duration 값도 포함시켜서 다양한 상황에 맞게 유연하게 설정할 수 있도록 개선해보세요:

- const [toast, setToast] = useState({
-   show: false,
-   message: "",
-   icon: null,
- });
+ const [toast, setToast] = useState({
+   show: false,
+   message: "",
+   icon: null,
+   duration: 4000,
+ });

- const fireToast = (message, icon = ErrorIcon, duration = 4000) => {
-   setToast({ show: true, message, icon });
+ const fireToast = (message, icon = ErrorIcon, duration = 4000) => {
+   setToast({ show: true, message, icon, duration });

- {toast.show && (
-   <ToastModal
-     message={toast.message}
-     icon={toast.icon}
-     duration={4000}
-     onClose={() => setToast((t) => ({ ...t, show: false }))}
-   />
- )}
+ {toast.show && (
+   <ToastModal
+     message={toast.message}
+     icon={toast.icon}
+     duration={toast.duration}
+     onClose={() => setToast((t) => ({ ...t, show: false }))}
+   />
+ )}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b8ca949 and 7574520.

⛔ Files ignored due to path filters (1)
  • src/assets/svgs/modal/errorIcon.svg is excluded by !**/*.svg
📒 Files selected for processing (7)
  • src/components/common/ToastModal.jsx (1 hunks)
  • src/pages/map/components/review/ConfirmImage.jsx (2 hunks)
  • src/pages/map/components/review/ReviewImageCapture.jsx (6 hunks)
  • src/pages/myPage/MyPage.jsx (4 hunks)
  • src/pages/review/StoreReviewPage.jsx (1 hunks)
  • src/pages/support/components/step/Step6.jsx (3 hunks)
  • src/pages/writeReview/components/WriteText.jsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/pages/map/components/review/ReviewImageCapture.jsx
  • src/pages/map/components/review/ConfirmImage.jsx
🔇 Additional comments (13)
src/pages/review/StoreReviewPage.jsx (1)

50-50: 네비게이션 동작이 변경되었습니다.

뒤로 가기 아이콘 클릭 시 이전 페이지로 돌아가는 대신(navigate(-1)) 홈페이지로 직접 이동(navigate("/"))하도록 변경되었습니다. 이는 동적 companyId 수정과 관련된 변경 사항의 일부인 것으로 보입니다.

src/components/common/ToastModal.jsx (1)

23-23: 텍스트 스타일 및 줄바꿈 처리가 개선되었습니다.

토스트 메시지의 스타일이 변경되었습니다:

  • font-semibold whitespace-nowrap에서 b4 whitespace-pre-line으로 변경
  • 이제 메시지 텍스트에서 줄바꿈(\n)이 제대로 표시되며, 보다 일관된 텍스트 스타일(b4)이 적용됩니다.

이 변경으로 여러 줄의 오류 메시지가 있는, 특히 수정된 영수증 리뷰 기능에서 더 나은 사용자 경험을 제공할 수 있습니다.

src/pages/support/components/step/Step6.jsx (3)

3-17: Alert 대신 ToastModal을 사용한 개선된 에러 처리 방식 도입

기존의 alert 다이얼로그 대신 비차단(non-blocking) 토스트 알림을 사용하도록 변경되었습니다. 이는 사용자 경험을 개선하고 시각적으로 더 세련된 피드백을 제공합니다.

토스트 상태 관리와 fireToast 유틸리티 함수는 잘 구현되어 있습니다.


27-27: 에러 처리 방식 개선

alert에서 토스트 알림으로 에러 처리 방식이 변경되었습니다.


64-71: ToastModal 컴포넌트 조건부 렌더링 추가

토스트 상태에 따라 ToastModal 컴포넌트를 조건부로 렌더링하는 코드가 추가되었습니다. 이는 앱 전체에서 사용자 피드백 메커니즘을 표준화하는 좋은 접근법입니다.

src/pages/myPage/MyPage.jsx (5)

10-11: 토스트 알림 시스템을 위한 필요한 컴포넌트 임포트

ErrorIcon과 ToastModal을 임포트하여 토스트 알림 시스템을 구현하기 위한 준비가 되었습니다.


38-46: 토스트 알림 시스템 상태 관리 구현

토스트 알림의 표시, 메시지, 아이콘을 관리하기 위한 상태와 유틸리티 함수를 추가했습니다. 이는 다른 컴포넌트(Step6.jsx 등)와 동일한 패턴을 따르며 일관된 사용자 경험을 제공합니다.


68-68: 로그아웃 실패 처리 개선

로그아웃 실패 시 기존 alert 대신 토스트 알림을 사용하도록 변경되었습니다.


75-75: 로딩 텍스트 스타일 개선

로딩 텍스트에 b4 클래스를 적용하여 스타일을 개선했습니다.


137-144: 토스트 모달 컴포넌트 조건부 렌더링

토스트 알림 시스템의 시각적 부분을 구현한 코드입니다. 이는 다른 페이지의 구현과 일관되며, 앱 전체에서 통일된 알림 UI를 제공합니다.

src/pages/writeReview/components/WriteText.jsx (3)

8-9: 새로운 토스트 모달 관련 임포트 추가

Toast 알림 시스템에 필요한 ErrorIcon과 ToastModal 컴포넌트가 적절하게 임포트되었습니다.


39-39: alert 대신 토스트 알림으로 개선

에러 핸들링 방식이 기존 alert에서 토스트 알림으로 변경되었습니다. 이 변경으로 UX가 향상되었습니다.


1-120: PR 목표와 현재 파일 변경사항 간의 불일치

PR 제목 "Fix: 영수증 리뷰 companyId 고정값 수정"과 목표에 언급된 "companyId 고정값을 동적으로 변경" 및 "영수증 리뷰 확인 창에 회사 카테고리 표시"는 이 파일의 변경사항에서 확인되지 않습니다. 대신 alert을 토스트 알림으로 대체하는 변경만 적용되었습니다.

PR 목표에 맞는 변경사항이 다른 파일에 적용되었는지 확인해 주세요.

Copy link
Collaborator

@shroqkf shroqkf left a comment

Choose a reason for hiding this comment

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

토스트모달 duration 4000으로 따로 주셨는데 이유가 있을까요? 현재 모달이 오래 떠있어서 오류 걸린 느낌이라 공통 컴포넌트에 지정한 1300 정도로 주면 좋을 것 같습니다.

@shroqkf shroqkf merged commit 7dfe3a2 into develop May 13, 2025
3 of 4 checks passed
@shroqkf shroqkf deleted the feature/fixReview branch May 13, 2025 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants