Skip to content

Conversation

@klmhyeonwoo
Copy link
Collaborator

@klmhyeonwoo klmhyeonwoo commented Apr 22, 2025

목적

  • 구독 모달 구조를 카테고리 중심에서 키워드 중심으로 변경을 진행했어요

작업 내용

  • 커밋 내용을 참고해주세요

필수 리뷰어

이슈 번호

비고

  • 커밋이 꼬여서 충돌 푸느라 시간이 오래걸렸네요.. 레거시 구조는 점진적으로 고쳐나가겠습니다!

Summary by CodeRabbit

  • New Features

    • Introduced a Chip component for keyword input and management.
    • Added keyword-based subscription functionality with support for up to three keywords.
    • Implemented a utility for formatting time as MM:SS.
  • Enhancements

    • Subscription modal now uses keyword input instead of category toggles.
    • Improved email verification flow with a 5-minute countdown timer and inline feedback.
    • Enhanced error messages with more specific details from API responses.
  • UI/UX Improvements

    • Updated styles for buttons, inputs, and modal layouts for a more consistent look.
    • Disabled state styling improved for buttons and input fields.
    • Consent checkboxes and agreement flow added to subscription modal.
  • Bug Fixes

    • Fixed logic for enabling/disabling buttons and certificate boxes using the standard disabled attribute.
  • Chores

    • Added SASS support for improved styling.
    • Updated color variables for better accessibility.
  • Refactor

    • Replaced non-standard props with standard HTML attributes for better maintainability.
    • Simplified and clarified component props and type definitions.

@klmhyeonwoo klmhyeonwoo self-assigned this Apr 22, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 22, 2025

Walkthrough

This update adds the sass package and a new SCSS variable file, adjusts import order, and refines styling across multiple components using CSS variables and updated dimensions. The Button and CertificateBox components are refactored to replace custom props with standard disabled attributes and simplify styling. A new Chip component is introduced. The subscription modal is reworked to support keyword-based subscriptions with enhanced email verification and consent handling. The ModalType type's title property is made optional. Error handling and API subscription calls are enhanced, and a new time formatting utility is added.

Changes

File(s) Change Summary
package.json Added "sass": "^1.87.0" to devDependencies.
src/App.tsx, src/style/variable.scss Adjusted CSS import order; added variable.scss. Changed --text-disabled color from #8e8e8e to #c6c6c6.
src/app/home/index.tsx Removed title property from modal open call; minor formatting changes; no logic changes.
src/components/app/signup/certificate-box.tsx Renamed prop check to disabled; replaced color constants with CSS variables; updated container styling including border-radius, padding, font size/weight, flex alignment, and disabled state styling.
src/components/common/Button.tsx Removed state prop; switched to :disabled CSS styling; updated dimensions, font, icon margin, and added CSS transition; added TODO comment for style separation.
src/components/common/Input.tsx Changed input prop type to include all attributes; updated container width, icon padding, input height, border-radius, font size, text color, and added disabled state styles.
src/components/common/chip.tsx Added new Chip component supporting display with optional close icon or inputable chip variant with add icon and input field; styled with Emotion CSS and CSS variables.
src/components/common/modal/Modal.tsx Changed modal container padding to uniform 3.2rem; removed inner content row-gap; reformatted button container display property without logic change.
src/components/common/modal/SubscriptionModalContent.tsx Refactored subscription modal: replaced category toggles with keyword input (max 3 keywords); replaced email state with useCheckEmail hook; added 5-minute email verification timer and UI feedback; added user consent checkboxes; updated subscription logic to include keywords and consent; restructured UI with Emotion CSS; removed alerts in favor of inline messages.
src/types/modal.ts Made title property in ModalType optional (title?: string).
src/api/index.ts Enhanced error handler to extract and use detailed error messages from API response payloads when available, falling back to status text otherwise.
src/app/signin/index.tsx Replaced state prop on login Button with standard disabled prop, maintaining same condition for enabling/disabling.
src/app/signup/consent/index.tsx Replaced state prop on Button with disabled prop using same logical condition.
src/app/signup/index.tsx Replaced check prop with disabled on CertificateBox components; reformatted calls to sendVerifyEmail and verifyEmail; replaced state prop with disabled on submit Button; adjusted enabling/disabling logic accordingly.
src/hooks/api/subscribe/useApiSendSubscribe.ts Extended sendSubscribeEmail interface and function to include keywords: string[] in addition to email; updated API request payload accordingly.
src/utils/dateUtil.ts Added new utility exporting formatTime(seconds: number): string to convert seconds into "MM:SS" format with zero padding.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SubscriptionModalContent
    participant useCheckEmail
    participant API

    User->>SubscriptionModalContent: Open modal
    SubscriptionModalContent->>User: Show keyword chips, email input
    User->>SubscriptionModalContent: Enter email, click "인증번호 받기"
    SubscriptionModalContent->>useCheckEmail: Validate email
    useCheckEmail-->>SubscriptionModalContent: Return validity
    alt Email valid
        SubscriptionModalContent->>API: Send verification email
        API-->>SubscriptionModalContent: Response (logged)
    end
    User->>SubscriptionModalContent: Enter verification code (input disabled until sent)
    User->>SubscriptionModalContent: Click "구독 완료" (button disabled until verified and consent given)
Loading

Suggested reviewers

  • joeunSong

Poem

🐇 In code fields where changes hop,
Buttons shed states that made them stop.
Chips now sparkle, keywords grow,
A timer ticks, subscriptions flow.
Sass and SCSS weave their art,
Disabled hues play their part.
Hooray! The UI’s got a fresh new heart! 🌸✨


📜 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 f13ef60 and b8cd748.

📒 Files selected for processing (2)
  • src/app/signin/index.tsx (1 hunks)
  • src/app/signup/consent/index.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/app/signin/index.tsx
  • src/app/signup/consent/index.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.

@klmhyeonwoo klmhyeonwoo marked this pull request as draft April 22, 2025 13:53
@github-actions github-actions bot requested review from Cllaude99 and joeunSong April 22, 2025 13:53
Copy link
Contributor

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

🧹 Nitpick comments (4)
src/components/common/chip.tsx (1)

18-38: CSS properties might be conflicting

The combination of width: 100% with max-width: fit-content (and similar for height) might be confusing or potentially conflicting.

Consider simplifying the size properties:

const chipCss = css`
  display: flex;
  align-items: center;
  column-gap: 2px;
  background-color: #fff;
  border: 1px solid var(--gray-10);
  border-radius: 4px;
  padding: 4px 8px;
-  width: 100%;
-  height: 100%;
-  max-width: fit-content;
-  max-height: fit-content;
+  width: fit-content;
+  height: fit-content;

  & > img {
    cursor: pointer;
  }

  & > span {
    color: var(--text-body2);
  }
`;
src/components/app/signup/certificate-box.tsx (2)

18-23: Incorrect id value and potential accessibility issue

The JSX element is given an id="certificateb-box" (note the extra b) which is likely a typo.
While IDs are rarely consumed directly in React, typos make DOM inspection/debugging harder and can break automated tests or CSS hooks relying on the correct value.

Suggested fix:

-      id="certificateb-box"
+      id="certificate-box"

Also applies to: 24-31


33-42: cursor: pointer remains active even when the component is disabled

Although pointer-events: none prevents clicks, the cursor styling still communicates that the element is interactive.
To give consistent feedback to users (and assistive tech), switch the cursor to default in the disabled branch.

-          pointer-events: none;
-          background-color: var(--gray-10);
-          color: var(--text-disabled);
+          pointer-events: none;
+          cursor: default;
+          background-color: var(--gray-10);
+          color: var(--text-disabled);
src/components/common/modal/SubscriptionModalContent.tsx (1)

22-33: Unused variable res – remove or log meaningfully

Even after awaiting, res is never used.
Either destructure needed data (e.g., HTTP status) or omit the variable:

-      const res = await sendVerifyEmail({...});
-      setVerifySendCheck(true);
+      await sendVerifyEmail({...});
+      setVerifySendCheck(true);

Also applies to: 36-47

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 680ff4e and f419b2d.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/assets/chip/delete.svg is excluded by !**/*.svg
📒 Files selected for processing (11)
  • package.json (1 hunks)
  • src/App.tsx (1 hunks)
  • src/app/home/index.tsx (1 hunks)
  • src/components/app/signup/certificate-box.tsx (1 hunks)
  • src/components/common/Button.tsx (3 hunks)
  • src/components/common/Input.tsx (4 hunks)
  • src/components/common/chip.tsx (1 hunks)
  • src/components/common/modal/Modal.tsx (2 hunks)
  • src/components/common/modal/SubscriptionModalContent.tsx (3 hunks)
  • src/style/variable.scss (1 hunks)
  • src/types/modal.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/app/home/index.tsx (1)
src/components/common/modal/SubscriptionModalContent.tsx (1)
  • SubscriptionModalContent (14-124)
src/components/app/signup/certificate-box.tsx (1)
src/style/variable.ts (1)
  • DESIGN_SYSTEM_TEXT (3-121)
src/components/common/modal/SubscriptionModalContent.tsx (9)
src/hooks/useModal.ts (1)
  • useModal (9-31)
src/hooks/useCheckEmail.ts (1)
  • useCheckEmail (4-19)
src/hooks/api/member/useApiSendVerifyEmail.ts (1)
  • sendVerifyEmail (7-14)
src/utils/common.ts (1)
  • EMAIL_PURPOSE (11-11)
src/hooks/api/member/useApiVerifyEmail.ts (1)
  • verifyEmail (8-16)
src/components/common/chip.tsx (1)
  • Chip (9-16)
src/components/common/Input.tsx (1)
  • Input (8-63)
src/components/app/signup/certificate-box.tsx (1)
  • CertificateBox (11-49)
src/components/common/Button.tsx (1)
  • Button (9-54)
🪛 GitHub Check: build
src/components/common/modal/SubscriptionModalContent.tsx

[failure] 39-39:
'res' is declared but its value is never read.


[failure] 36-36:
'handleVerifyEmailCode' is declared but its value is never read.


[failure] 18-18:
'setKeywordList' is declared but its value is never read.


[failure] 18-18:
'keywordList' is declared but its value is never read.

🪛 ESLint
src/components/common/modal/SubscriptionModalContent.tsx

[error] 18-18: 'keywordList' is assigned a value but never used.

(@typescript-eslint/no-unused-vars)


[error] 18-18: 'setKeywordList' is assigned a value but never used.

(@typescript-eslint/no-unused-vars)


[error] 36-36: 'handleVerifyEmailCode' is assigned a value but never used.

(@typescript-eslint/no-unused-vars)


[error] 39-39: 'res' is assigned a value but never used.

(@typescript-eslint/no-unused-vars)

🔇 Additional comments (18)
package.json (1)

46-46: LGTM: Added Sass dependency

The addition of the Sass dependency is appropriate for enabling SCSS styling in the project, which is used in the new variable.scss file.

src/style/variable.scss (1)

20-20: Color update for disabled text is appropriate

Changing the disabled text color to a lighter gray (#c6c6c6) improves the visual distinction for disabled UI elements.

src/App.tsx (1)

6-7: LGTM: Good import order for styles

Adding the SCSS variables import is appropriate, and placing it after global.css ensures proper style cascade.

src/types/modal.ts (1)

4-4: LGTM: Making title optional provides flexibility

Making the title property optional is a good change that provides more flexibility for different modal designs.

src/app/home/index.tsx (2)

114-117: LGTM: Consistent JSDoc formatting.

The JSDoc comment formatting looks clean, maintaining a consistent style with the rest of the codebase.


120-121: Better maintainability with trailing comma.

Adding the trailing comma improves maintainability by ensuring future additions to this object won't cause multi-line git diffs.

src/components/common/modal/Modal.tsx (2)

60-60: Improved visual balance with consistent padding.

Changing to uniform padding (3.2rem) creates a more balanced and visually pleasing modal container, consistent with modern UI design principles.


94-94: LGTM: Consistent style formatting.

The spacing around the colon and use of double quotes improves code readability while maintaining the same functionality.

src/components/common/Input.tsx (4)

16-16: Improved layout control with explicit width.

Setting width: 100% ensures the input container properly fills its parent container, preventing unexpected layout issues.


29-30: Enhanced precision with fixed pixel values.

Changing from 2rem to 16px provides more precise control over spacing and aligns with the pixel-based approach used in other style updates.


39-42: UI consistency improvements with updated dimensions and styling.

The changes to height, border-radius, font-size, and color create a more consistent input component that aligns with the overall design system. Using CSS variables for text color improves theme consistency.


52-56: Properly handled disabled state.

Adding specific styles for the disabled state improves user experience by providing clear visual feedback when an input is not interactive. Using CSS variables ensures consistency with other disabled elements.

src/components/common/Button.tsx (6)

3-4: Good identification of future improvement.

The TODO comment correctly identifies the need to separate inline styles, which will improve maintainability and reusability in the future.


9-9: Simplified component API.

Removing the state boolean parameter streamlines the component's API by relying on the standard disabled HTML attribute instead of a custom prop.


13-18: Improved container layout control.

Setting width: 100% ensures the button container properly fills its parent, preventing layout inconsistencies.


24-25: Enhanced precision with fixed pixel values.

Changing from 3.6rem to 16px provides more precise spacing control and aligns with the pixel-based approach in other component updates.


32-40: Modernized button styling with improved visual consistency.

The updates to height, border-radius, font-size, and font-weight create a more modern and consistent button appearance. Adding a transition provides a smoother user experience when states change.


42-46: Better disabled state handling with CSS pseudo-classes.

Replacing the conditional state prop with the standard :disabled pseudo-class is a significant improvement that:

  1. Follows web standards
  2. Makes the code more maintainable
  3. Leverages CSS variables for consistent theming

This approach is more elegant and sustainable than the previous implementation.

@klmhyeonwoo klmhyeonwoo force-pushed the feature/102 branch 2 times, most recently from 9a653fc to 5d1640f Compare May 25, 2025 13:23
@klmhyeonwoo klmhyeonwoo marked this pull request as ready for review May 28, 2025 09:37
Copy link
Contributor

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

♻️ Duplicate comments (5)
src/components/common/modal/SubscriptionModalContent.tsx (5)

52-64: API calls need proper async/await handling.

The sendVerifyEmail API call is not awaited, so the try/catch block won't catch Promise rejections and setVerifySendCheck(true) will execute regardless of success or failure.


66-78: Function is defined but never used.

The handleVerifyEmailCode function is declared but never called anywhere in the component.

🧰 Tools
🪛 ESLint

[error] 66-66: 'handleVerifyEmailCode' is assigned a value but never used.

(@typescript-eslint/no-unused-vars)


[error] 69-69: 'res' is assigned a value but never used.

(@typescript-eslint/no-unused-vars)


86-88: Reference to removed categories object causes runtime crash.

The categories object no longer exists after migrating to keyword-based selection, but it's still referenced here, which will cause a ReferenceError.


161-166: Email verification input is permanently disabled.

The verification code input is hard-coded as disabled={true}, preventing users from entering the verification code.


168-170: Subscription button is permanently disabled.

The subscription button is hard-coded as disabled={true}, preventing users from completing the subscription process.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f419b2d and 5d1640f.

⛔ Files ignored due to path filters (1)
  • src/assets/chip/plus.svg is excluded by !**/*.svg
📒 Files selected for processing (2)
  • src/components/common/chip.tsx (1 hunks)
  • src/components/common/modal/SubscriptionModalContent.tsx (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/common/modal/SubscriptionModalContent.tsx (9)
src/hooks/useModal.ts (1)
  • useModal (9-31)
src/hooks/useCheckEmail.ts (1)
  • useCheckEmail (4-19)
src/hooks/api/member/useApiSendVerifyEmail.ts (1)
  • sendVerifyEmail (7-14)
src/utils/common.ts (1)
  • EMAIL_PURPOSE (11-11)
src/hooks/api/member/useApiVerifyEmail.ts (1)
  • verifyEmail (8-16)
src/components/common/chip.tsx (1)
  • Chip (14-43)
src/components/common/Input.tsx (1)
  • Input (8-63)
src/components/app/signup/certificate-box.tsx (1)
  • CertificateBox (11-49)
src/components/common/Button.tsx (1)
  • Button (9-54)
🪛 ESLint
src/components/common/modal/SubscriptionModalContent.tsx

[error] 13-13: 'set' is defined but never used.

(@typescript-eslint/no-unused-vars)


[error] 66-66: 'handleVerifyEmailCode' is assigned a value but never used.

(@typescript-eslint/no-unused-vars)


[error] 69-69: 'res' is assigned a value but never used.

(@typescript-eslint/no-unused-vars)

🔇 Additional comments (2)
src/components/common/chip.tsx (1)

6-12: Type definition looks good for dual-mode component.

The prop types appropriately support both inputable and display modes with optional handlers.

src/components/common/modal/SubscriptionModalContent.tsx (1)

175-274: Well-structured CSS organization.

The new CSS-in-JS styling is well-organized with logical groupings and consistent use of CSS variables. The responsive design and spacing are appropriate.

Copy link
Contributor

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

🔭 Outside diff range comments (3)
src/app/signup/index.tsx (3)

169-175: ⚠️ Potential issue

Critical logic error: Signup button disabled condition is inverted.

The signup button should be enabled when all required fields are filled and email is verified, but the current logic disables it when all conditions are met. This prevents users from completing signup.

Apply this fix:

-        disabled={Boolean(
-          verifyEmailNumCheck &&
-            email &&
-            password &&
-            verifyPassWordNum &&
-            nickname,
-        )}
+        disabled={!(
+          verifyEmailNumCheck &&
+            email &&
+            password &&
+            verifyPassWordNum &&
+            nickname
+        )}

147-150: 🛠️ Refactor suggestion

Missing password validation: Passwords should match.

The form collects both password and password confirmation but doesn't validate that they match before allowing submission.

Add password matching validation:

+        disabled={!(
+          verifyEmailNumCheck &&
+            email &&
+            password &&
+            verifyPassWordNum &&
+            password === verifyPassWordNum &&
+            nickname
+        )}

132-132: 🛠️ Refactor suggestion

Missing password strength validation.

The placeholder mentions specific requirements ("영문 숫자, 6-17자") but there's no validation to enforce these rules.

Consider adding password strength validation:

const isValidPassword = (pwd: string) => {
  const hasLetter = /[a-zA-Z]/.test(pwd);
  const hasNumber = /\d/.test(pwd);
  const isValidLength = pwd.length >= 6 && pwd.length <= 17;
  return hasLetter && hasNumber && isValidLength;
};
♻️ Duplicate comments (3)
src/components/common/chip.tsx (3)

31-31: CSS conflict issue from previous review still present.

The input element still incorrectly applies chipCss inside an inputableChipCss container, creating styling conflicts as identified in previous reviews.


104-114: Unused input-specific styles still present in chipCss.

The chipCss still contains input-specific styles that are unnecessary and inconsistent, as noted in previous reviews. These should be removed to clean up the styling.


10-10: Confusing onClick prop usage still unresolved.

The onClick prop serves different purposes in inputable mode (add functionality) vs closable mode (delete functionality), which creates confusion as mentioned in previous reviews. Consider separating these into distinct props like onAdd and onDelete.

🧹 Nitpick comments (1)
src/components/common/modal/SubscriptionModalContent.tsx (1)

42-42: Fix variable name typo.

There's a typo in the variable name remaingTime - it should be remainingTime.

-  const [remaingTime, setRemainingTime] = useState(300);
+  const [remainingTime, setRemainingTime] = useState(300);

Also update the usage on line 317:

-              <span> 유효시간 {dateUtil.formatTime(remaingTime)} </span>
+              <span> 유효시간 {dateUtil.formatTime(remainingTime)} </span>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5d1640f and 1ede572.

⛔ Files ignored due to path filters (2)
  • src/assets/checkbox/circle_checked_default.svg is excluded by !**/*.svg
  • src/assets/checkbox/circle_checked_fill.svg is excluded by !**/*.svg
📒 Files selected for processing (9)
  • src/api/index.ts (1 hunks)
  • src/app/signin/index.tsx (1 hunks)
  • src/app/signup/consent/index.tsx (1 hunks)
  • src/app/signup/index.tsx (3 hunks)
  • src/components/common/Input.tsx (5 hunks)
  • src/components/common/chip.tsx (1 hunks)
  • src/components/common/modal/SubscriptionModalContent.tsx (1 hunks)
  • src/hooks/api/subscribe/useApiSendSubscribe.ts (1 hunks)
  • src/utils/dateUtil.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/common/Input.tsx
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/app/signup/index.tsx (3)
src/hooks/api/member/useApiSendVerifyEmail.ts (1)
  • sendVerifyEmail (7-14)
src/utils/common.ts (1)
  • EMAIL_PURPOSE (11-11)
src/hooks/api/member/useApiVerifyEmail.ts (1)
  • verifyEmail (8-16)
src/hooks/api/subscribe/useApiSendSubscribe.ts (1)
src/api/index.ts (1)
  • api (134-134)
src/components/common/modal/SubscriptionModalContent.tsx (10)
src/hooks/useModal.ts (1)
  • useModal (9-31)
src/hooks/useCheckEmail.ts (1)
  • useCheckEmail (4-19)
src/hooks/api/member/useApiSendVerifyEmail.ts (1)
  • sendVerifyEmail (7-14)
src/utils/common.ts (1)
  • EMAIL_PURPOSE (11-11)
src/hooks/api/member/useApiVerifyEmail.ts (1)
  • verifyEmail (8-16)
src/hooks/api/subscribe/useApiSendSubscribe.ts (1)
  • sendSubscribeEmail (9-16)
src/components/common/chip.tsx (1)
  • Chip (16-49)
src/components/common/Input.tsx (1)
  • Input (8-63)
src/components/app/signup/certificate-box.tsx (1)
  • CertificateBox (11-49)
src/components/common/Button.tsx (1)
  • Button (9-54)
🔇 Additional comments (16)
src/app/signup/index.tsx (4)

82-82: LGTM! Email verification send button logic is correct.

The button is properly disabled when the email is valid but the verification hasn't been sent yet.


84-87: LGTM! API call formatting improved.

The sendVerifyEmail call is now properly formatted for better readability.


105-105: LGTM! Email verification confirm button logic is correct.

The button is properly disabled when the verification code is entered but not yet verified.


110-110: LGTM! Consistent formatting for email purpose parameter.

The emailPurpose parameter formatting is consistent with the previous API call.

src/utils/dateUtil.ts (1)

1-7: LGTM! Clean and focused utility implementation.

The formatTime function is well-implemented with correct time calculation logic and proper zero-padding for consistent MM:SS format display. This utility effectively supports the countdown timer functionality in the subscription modal.

src/api/index.ts (2)

81-82: Good enhancement for extracting detailed error messages.

The addition of description extraction from the API response payload improves error messaging by providing more specific feedback to users when available.


90-113: Consistent application of enhanced error messaging across all status codes.

The use of nullish coalescing (??) ensures proper fallback to default messages while utilizing the extracted description when available. This provides better user experience with more contextual error information.

src/hooks/api/subscribe/useApiSendSubscribe.ts (3)

5-5: Good addition of keywords support to subscription interface.

The keywords property properly extends the interface to support the new keyword-based subscription model.


8-8: Helpful TODO comment for future improvements.

The TODO comment appropriately identifies the need to refactor this into a proper API hook structure, which would improve consistency with other API interactions.


9-13: Function correctly updated to support keywords parameter.

The function signature and API request payload properly include the keywords array, enabling the keyword-based subscription functionality described in the PR objectives.

src/components/common/modal/SubscriptionModalContent.tsx (6)

138-138: Clarify keyword validation logic in email verification.

The condition if (keywordList?.[0]?.value?.trim() === "") return; only checks the first keyword. This seems inconsistent with the overall keyword management approach where multiple keywords can be added.

Should this check verify that at least one non-empty keyword exists, or is there a specific reason to only check the first keyword?

Consider using:

-    if (keywordList?.[0]?.value?.trim() === "") return;
+    const hasValidKeywords = keywordList.some(k => k.value.trim() !== "");
+    if (!hasValidKeywords) return;

166-194: Timer implementation looks good.

The timer functionality is well-implemented with proper cleanup, state management, and countdown logic. Good use of cleanup in the effect and proper timer state handling.


211-232: Subscription completion logic is well-implemented.

The function properly filters empty keywords, handles the API call asynchronously, and provides appropriate error handling and user feedback.


250-272: Chip component usage is complex but functional.

The Chip component integration with both closable and inputable properties based on the keyword state works well. The event handlers properly manage the add/edit/remove functionality for keywords.


342-350: Subscription button properly enabled based on conditions.

Good improvement from previous reviews - the button is now properly enabled only when email verification is complete and all checkboxes are checked.


356-508: CSS styling is well-organized and follows good practices.

The emotion CSS-in-JS styling is properly structured with logical groupings, consistent use of design system variables, and appropriate responsive considerations.

Copy link
Member

@Cllaude99 Cllaude99 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!
disabled와 관련해서 코멘트 남겼습니다. 확인 한 번 부탁드려요~

margin-top: 5.6rem;
`}
state={isValidEmail && password.length > 5}
disabled={isValidEmail && password.length > 5}
Copy link
Member

Choose a reason for hiding this comment

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

로그인 버튼의 비활성화될때에는 !isValidEamil || password.length <= 5 이어야 한다고 생각했어요.
그래서 적어주신 코드에 !를 처리가 필요하다고 생각했어요. !(isValidEmail && password.length > 5) 처럼요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

d63a123 에서 반영 완료했어요, 감사해요!

margin-top: 1.6rem;
`}
state={privacy && useService}
disabled={privacy && useService}
Copy link
Member

Choose a reason for hiding this comment

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

여기도 마찬가지로 '개인정보 수집 및 이용' 이 체크되고 '이용약관'이 체크된 경우에만 다음 버튼이 활성화 되는 것으로 생각했어요!
따라서 !(privacy && useService) 라고 생각이 드는데 어떤지 여쭈어 봅니다!

Copy link
Collaborator Author

@klmhyeonwoo klmhyeonwoo May 28, 2025

Choose a reason for hiding this comment

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

b8cd748에서 반영 완료했어요, 감사해요!
충돌 방지하며 뇌를 빼고 코딩했다며.. 🥱

klmhyeonwoo and others added 2 commits May 28, 2025 23:15
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@joeunSong joeunSong left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!!

@klmhyeonwoo klmhyeonwoo merged commit 7fc6af3 into main May 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants