Skip to content

Conversation

@young-jin-son
Copy link
Collaborator

@young-jin-son young-jin-son commented Jul 15, 2025

Issue Number

close #290

As-Is

  • 로그아웃 안됐음
  • 서비스 피드백, 문의 링크 없었음

To-Be

  • 로그아웃 기능 구현
  • 서비스 피드백 링크 추가
  • 서비스 문의 링크 추가

Check List

  • 테스트가 전부 통과되었나요?
  • 모든 commit이 push 되었나요?
  • merge할 branch를 확인했나요?
  • Assignee를 지정했나요?
  • Label을 지정했나요?

Test Screenshot

변경 전 변경 후
image image

(Optional) Additional Description

Summary by CodeRabbit

  • New Features

    • Added a logout button, allowing users to securely log out and be redirected to the landing page.
    • Introduced feedback and inquiry links in the drawer for easy access to surveys and support.
    • Enhanced drawer menu with a new feedback prompt and additional action buttons.
    • Added new icons (Star, Pin, Send) for improved visual experience.
  • Improvements

    • Updated drawer menu icons for better clarity.
    • Refined drawer layout and styling for a more consistent and user-friendly interface.

@young-jin-son young-jin-son self-assigned this Jul 15, 2025
@young-jin-son young-jin-son added feat 새로운 기능 구현 FE 프론트엔드 작업 labels Jul 15, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 15, 2025

Walkthrough

This update introduces a logout feature and adds feedback-related links to the sidebar (drawer) in the frontend. It includes new API integration for logout, a logout button with supporting hooks and styles, new and updated icons, and modularizes the drawer UI with components for menu, feedback prompt, and feedback links. Drawer menu icons and layout are updated for clarity.

Changes

Files/Paths Change Summary
frontend/src/api/logout.ts, frontend/src/constants/url.ts Added logout API endpoint and logout function.
frontend/src/components/Button/LogoutButton/... Added LogoutButton component, styling, and custom hook for logout logic.
frontend/src/components/Drawer/Drawer.constants.ts, .../Drawer.styled.ts Updated drawer menu icons, added external links, renamed and added styled components for drawer layout.
frontend/src/components/Drawer/DrawerMenu.tsx, FeedbackPrompt.tsx, FeedbackLinks.tsx Added modular components for drawer menu, feedback prompt, and feedback links (including logout button).
frontend/src/components/Drawer/index.tsx Refactored Drawer to use new modular components and include feedback/footer section.
frontend/src/components/Icon/icons/Star.tsx, Pin.tsx, Send.tsx, index.ts Added new icon components (Star, Pin, Send) and exported them.
frontend/src/components/Icon/icons/Chart.tsx, User.tsx Refactored Chart and User icons to new SVG styles.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Drawer
    participant LogoutButton
    participant useLogout Hook
    participant API

    User->>Drawer: Opens sidebar
    Drawer->>LogoutButton: Renders LogoutButton
    User->>LogoutButton: Clicks "로그아웃"
    LogoutButton->>useLogout Hook: Triggers logoutMutation
    useLogout Hook->>API: POST /api/v1/auth/logout
    API-->>useLogout Hook: Returns response
    useLogout Hook->>User: Removes accessToken, navigates to /landing
Loading
sequenceDiagram
    participant User
    participant Drawer
    participant FeedbackLinks

    User->>Drawer: Opens sidebar
    Drawer->>FeedbackLinks: Renders feedback buttons
    User->>FeedbackLinks: Clicks "설문조사" or "1:1 문의"
    FeedbackLinks->>Browser: Opens external link in new tab
Loading

Assessment against linked issues

Objective Addressed Explanation
로그아웃 기능 구현 (#290)
사이드바에 설문 링크 추가 (#290)

Poem

A logout hop, a survey leap,
Sidebar links where feedback peep.
New icons twinkle, menus shine,
Components modular—oh, so fine!
With every click, a bunny cheers—
"Your logout’s here, now have no fears!"
🐇✨

✨ 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
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: 10

🧹 Nitpick comments (2)
frontend/src/components/Button/LogoutButton/LogoutButton.styled.ts (1)

3-9: Minor UX polish for a button that looks like a link

Add pointer cursor & remove default button chrome for consistent look.

   ${({ theme }) => theme.fonts.label14Med};
   color: ${({ theme }) => theme.colors.gray600};
   display: flex;
   text-decoration: underline;
+  background: none;
+  border: none;
+  padding: 0;
+  cursor: pointer;
   margin-top: 1.6rem;
frontend/src/components/Drawer/FeedbackPrompt.tsx (1)

6-16: Consider extracting hardcoded text for internationalization.

The Korean text is hardcoded in the component. Consider extracting it to a constants file or internationalization system for better maintainability.

+const FEEDBACK_TEXT = {
+  TITLE: '두리번 서비스에 대한',
+  SUBTITLE: '소중한 피드백을 보내주세요 :)',
+} as const;
+
 const FeedbackPrompt = () => {
   return (
     <S.DrawerFeedbackPrompt>
       <Icon icon="Send" width={24} height={24} color={theme.colors.green600} />
       <div>
-        <div>두리번 서비스에 대한</div>
-        <div>소중한 피드백을 보내주세요 :)</div>
+        <div>{FEEDBACK_TEXT.TITLE}</div>
+        <div>{FEEDBACK_TEXT.SUBTITLE}</div>
       </div>
     </S.DrawerFeedbackPrompt>
   );
 };
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e075756 and eb1a0b4.

📒 Files selected for processing (17)
  • frontend/src/api/logout.ts (1 hunks)
  • frontend/src/components/Button/LogoutButton/LogoutButton.styled.ts (1 hunks)
  • frontend/src/components/Button/LogoutButton/hooks/useLogout.ts (1 hunks)
  • frontend/src/components/Button/LogoutButton/index.tsx (1 hunks)
  • frontend/src/components/Drawer/Drawer.constants.ts (1 hunks)
  • frontend/src/components/Drawer/Drawer.styled.ts (2 hunks)
  • frontend/src/components/Drawer/DrawerMenu.tsx (1 hunks)
  • frontend/src/components/Drawer/FeedbackLinks.tsx (1 hunks)
  • frontend/src/components/Drawer/FeedbackPrompt.tsx (1 hunks)
  • frontend/src/components/Drawer/index.tsx (1 hunks)
  • frontend/src/components/Icon/icons/Chart.tsx (1 hunks)
  • frontend/src/components/Icon/icons/Pin.tsx (1 hunks)
  • frontend/src/components/Icon/icons/Send.tsx (1 hunks)
  • frontend/src/components/Icon/icons/Star.tsx (1 hunks)
  • frontend/src/components/Icon/icons/User.tsx (1 hunks)
  • frontend/src/components/Icon/icons/index.ts (1 hunks)
  • frontend/src/constants/url.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
frontend/src/components/Icon/icons/Send.tsx (1)
Learnt from: rbgksqkr
PR: softeer5th/Team6-DuBu#37
File: frontend/src/components/Icon/icons/Alert.tsx:16-17
Timestamp: 2025-02-04T05:12:55.556Z
Learning: In React components, SVG attributes should use camelCase (e.g., strokeLinecap instead of stroke-linecap) to prevent console warning messages.
frontend/src/components/Icon/icons/Star.tsx (1)
Learnt from: rbgksqkr
PR: softeer5th/Team6-DuBu#37
File: frontend/src/components/Icon/icons/Alert.tsx:16-17
Timestamp: 2025-02-04T05:12:55.556Z
Learning: In React components, SVG attributes should use camelCase (e.g., strokeLinecap instead of stroke-linecap) to prevent console warning messages.
frontend/src/components/Icon/icons/Chart.tsx (1)
Learnt from: rbgksqkr
PR: softeer5th/Team6-DuBu#37
File: frontend/src/components/Icon/icons/Alert.tsx:16-17
Timestamp: 2025-02-04T05:12:55.556Z
Learning: In React components, SVG attributes should use camelCase (e.g., strokeLinecap instead of stroke-linecap) to prevent console warning messages.
frontend/src/components/Icon/icons/User.tsx (1)
Learnt from: rbgksqkr
PR: softeer5th/Team6-DuBu#37
File: frontend/src/components/Icon/icons/Alert.tsx:16-17
Timestamp: 2025-02-04T05:12:55.556Z
Learning: In React components, SVG attributes should use camelCase (e.g., strokeLinecap instead of stroke-linecap) to prevent console warning messages.
frontend/src/components/Icon/icons/Pin.tsx (1)
Learnt from: rbgksqkr
PR: softeer5th/Team6-DuBu#37
File: frontend/src/components/Icon/icons/Alert.tsx:16-17
Timestamp: 2025-02-04T05:12:55.556Z
Learning: In React components, SVG attributes should use camelCase (e.g., strokeLinecap instead of stroke-linecap) to prevent console warning messages.
🧬 Code Graph Analysis (6)
frontend/src/api/logout.ts (1)
frontend/src/constants/url.ts (1)
  • API_URL (5-74)
frontend/src/components/Button/LogoutButton/index.tsx (1)
frontend/src/components/Button/LogoutButton/LogoutButton.styled.ts (1)
  • LogoutButton (3-9)
frontend/src/components/Drawer/FeedbackLinks.tsx (2)
frontend/src/components/Drawer/Drawer.constants.ts (1)
  • EXTERNAL_LINKS (8-11)
frontend/src/components/Button/LogoutButton/LogoutButton.styled.ts (1)
  • LogoutButton (3-9)
frontend/src/components/Button/LogoutButton/hooks/useLogout.ts (1)
frontend/src/api/logout.ts (1)
  • logout (5-9)
frontend/src/components/Drawer/index.tsx (1)
frontend/src/components/Drawer/hooks/useDrawer.ts (1)
  • useDrawer (5-13)
frontend/src/components/Drawer/DrawerMenu.tsx (1)
frontend/src/components/Drawer/Drawer.constants.ts (1)
  • DRAWER_MENU (1-6)
🔇 Additional comments (20)
frontend/src/components/Button/LogoutButton/index.tsx (2)

1-3: LGTM: Clean import structure.

The imports are well-organized with clear separation between hook and styling imports.


10-11: LGTM: Proper default export.

The component is correctly exported as the default export.

frontend/src/components/Drawer/FeedbackPrompt.tsx (2)

1-5: LGTM: Clean import structure.

The imports are well-organized with proper separation of concerns.


18-19: LGTM: Proper default export.

The component is correctly exported as the default export.

frontend/src/components/Icon/icons/index.ts (1)

38-40: New icon exports verified – no issues found
All three icon files (Star.tsx, Pin.tsx, Send.tsx) exist in frontend/src/components/Icon/icons and each declares a proper export default. No further changes are needed.

frontend/src/components/Button/LogoutButton/hooks/useLogout.ts (3)

1-5: LGTM: Clean import structure.

The imports are well-organized with proper separation between external libraries and internal modules.


11-15: LGTM: Proper cleanup and navigation on successful logout.

The success handler correctly removes the access token and navigates to the landing page, which is the expected behavior for a logout operation.


20-21: LGTM: Proper default export.

The hook is correctly exported as the default export.

frontend/src/components/Drawer/Drawer.constants.ts (2)

2-3: LGTM: Icon updates improve visual consistency.

The icon changes from "Map" to "Pin" and "Favorite" to "Star" appear to be appropriate for the respective menu items and likely improve visual clarity.


8-11: External URLs Verified – No Further Action Required

Both https://tally.so/r/n0grZ9 and https://pf.kakao.com/_eKSJn return HTTP 200 and point to official, trusted services (Tally and Kakao). Since these are static, hard-coded links and not user-supplied input, additional runtime URL validation or whitelisting isn’t needed here.

frontend/src/components/Drawer/FeedbackLinks.tsx (1)

5-23: Well-implemented feedback links component.

The component correctly handles external link navigation with proper event handlers and integrates the LogoutButton appropriately. The use of constants for external URLs is a good practice.

frontend/src/components/Drawer/DrawerMenu.tsx (1)

9-33: Well-structured drawer menu component.

The component effectively modularizes the drawer navigation with proper routing integration, consistent theming, and clean separation of concerns. The use of the DRAWER_MENU constant and styled components follows good patterns.

frontend/src/components/Drawer/index.tsx (3)

4-6: LGTM: Clean component imports for modular architecture.

The new imports properly separate concerns by delegating menu rendering to DrawerMenu and feedback functionality to dedicated components. This improves maintainability and follows the single responsibility principle.


16-17: LGTM: Consistent naming with "Drawer" prefix.

The renamed styled components (DrawerOverlay, DrawerContent) provide better clarity and namespace consistency.


18-23: LGTM: Well-structured component composition.

The replacement of inline menu rendering with the DrawerMenu component and addition of the footer section with feedback components creates a cleaner, more maintainable structure. The DrawerFooterSection provides proper spacing and layout for the feedback UI.

frontend/src/components/Drawer/Drawer.styled.ts (5)

23-28: LGTM: Consistent component naming.

The rename from Overlay to DrawerOverlay improves clarity and maintains consistent naming conventions with the "Drawer" prefix.


53-61: LGTM: Well-structured header components.

The new DrawerHeaderSection and DrawerLogo components provide better semantic structure and appropriate spacing for the drawer header.


63-100: LGTM: Consistent navigation component naming.

The renaming from MenuList/MenuItem to DrawerNavigationList/DrawerNavigationItem maintains consistency with the "Drawer" prefix and improves semantic clarity.


102-113: LGTM: Well-styled feedback prompt component.

The DrawerFeedbackPrompt component has appropriate styling with good use of theme colors and spacing. The green color scheme effectively draws attention to the feedback request.


115-140: LGTM: Comprehensive footer styling components.

The new footer-related styled components (DrawerFooterSection, DrawerActionButtonWrapper, DrawerActionButton) provide proper layout structure and consistent styling for the feedback and action elements.

Comment on lines +27 to +29
// 로그아웃
logout: `${BASE_URL}/api/v1/auth/logout`,

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

MOCK section missing matching logout endpoint

API_URL.logout was added, but the equivalent entry is absent from MOCK_API_URL. This will break local-/storybook-style mocks or unit tests that rely on the mock map.

@@
   // 로그인
   loginKakao: `${BASE_URL}/api/v1/auth/KAKAO`,
   loginKakaoAuth: `${BASE_URL}/api/v1/auth/kakao-login`,
+  // 로그아웃
+  logout: `${BASE_URL}/api/v1/auth/logout`,

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In frontend/src/constants/url.ts around lines 27 to 29, the logout endpoint was
added to API_URL but the corresponding entry is missing in MOCK_API_URL. To fix
this, add a matching logout endpoint entry in the MOCK_API_URL object with the
same path or a mock path to ensure local mocks and unit tests function
correctly.

Comment on lines +8 to +22
<path
d="M20.4999 3.5L11.1499 12.85"
stroke={props.color || theme.colors.green600}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M20.5 3.5L14.55 20.5L11.15 12.85L3.5 9.45L20.5 3.5Z"
stroke={props.color || theme.colors.green600}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Use camelCase SVG attributes to avoid React warnings

React treats dashed SVG attributes as unknown DOM props and will print warnings. Apply camelCase (strokeWidth, strokeLinecap, strokeLinejoin).

-        stroke-width="1.5"
-        stroke-linecap="round"
-        stroke-linejoin="round"
+        strokeWidth="1.5"
+        strokeLinecap="round"
+        strokeLinejoin="round"
@@
-        stroke-width="1.5"
-        stroke-linecap="round"
-        stroke-linejoin="round"
+        strokeWidth="1.5"
+        strokeLinecap="round"
+        strokeLinejoin="round"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<path
d="M20.4999 3.5L11.1499 12.85"
stroke={props.color || theme.colors.green600}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M20.5 3.5L14.55 20.5L11.15 12.85L3.5 9.45L20.5 3.5Z"
stroke={props.color || theme.colors.green600}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<path
d="M20.4999 3.5L11.1499 12.85"
stroke={props.color || theme.colors.green600}
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M20.5 3.5L14.55 20.5L11.15 12.85L3.5 9.45L20.5 3.5Z"
stroke={props.color || theme.colors.green600}
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
🤖 Prompt for AI Agents
In frontend/src/components/Icon/icons/Send.tsx between lines 8 and 22, the SVG
attributes use dashed names like stroke-width, stroke-linecap, and
stroke-linejoin, which cause React warnings. Change these attribute names to
their camelCase equivalents: strokeWidth, strokeLinecap, and strokeLinejoin to
comply with React's expected prop naming conventions and eliminate the warnings.

Comment on lines +8 to +14
<path
d="M12 2.95117L14.781 8.58517L21 9.49417L16.5 13.8772L17.562 20.0692L12 17.1442L6.438 20.0692L7.5 13.8772L3 9.49417L9.219 8.58517L12 2.95117Z"
stroke={props.color || theme.colors.gray950}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Dash-cased SVG props trigger console warnings

Same issue as in Send.tsx.

-        stroke-width="1.5"
-        stroke-linecap="round"
-        stroke-linejoin="round"
+        strokeWidth="1.5"
+        strokeLinecap="round"
+        strokeLinejoin="round"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<path
d="M12 2.95117L14.781 8.58517L21 9.49417L16.5 13.8772L17.562 20.0692L12 17.1442L6.438 20.0692L7.5 13.8772L3 9.49417L9.219 8.58517L12 2.95117Z"
stroke={props.color || theme.colors.gray950}
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
/>
<path
d="M12 2.95117L14.781 8.58517L21 9.49417L16.5 13.8772L17.562 20.0692L12 17.1442L6.438 20.0692L7.5 13.8772L3 9.49417L9.219 8.58517L12 2.95117Z"
stroke={props.color || theme.colors.gray950}
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
🤖 Prompt for AI Agents
In frontend/src/components/Icon/icons/Star.tsx between lines 8 and 14, the SVG
properties use dash-case (stroke-width, stroke-linecap, stroke-linejoin) which
causes React console warnings. Change these SVG attribute names to camelCase
(strokeWidth, strokeLinecap, strokeLinejoin) to fix the warnings and follow
React's JSX syntax requirements.

Comment on lines +5 to +9
export const logout = async () => {
const result = await fetchClient.post(API_URL.logout);

return result;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add error handling & explicit return type

Uncaught promise rejections surface as generic “Unhandled Rejection” errors in React. Wrap the request, propagate the typed payload, and give consumers an explicit shape.

-export const logout = async () => {
-  const result = await fetchClient.post(API_URL.logout);
-  return result;
-};
+export const logout = async (): Promise<void> => {
+  try {
+    await fetchClient.post(API_URL.logout);
+  } catch (error) {
+    // Optionally log or send to Sentry
+    throw error;
+  }
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const logout = async () => {
const result = await fetchClient.post(API_URL.logout);
return result;
};
export const logout = async (): Promise<void> => {
try {
await fetchClient.post(API_URL.logout);
} catch (error) {
// Optionally log or send to Sentry
throw error;
}
}
🤖 Prompt for AI Agents
In frontend/src/api/logout.ts around lines 5 to 9, the logout function lacks
error handling and an explicit return type, causing unhandled promise rejections
in React. Add a try-catch block around the fetchClient.post call to catch and
handle errors properly. Define and use an explicit return type for the function
that matches the expected response payload, and ensure the function returns this
typed payload or throws an error as appropriate.

Comment on lines +4 to +8
const LogoutButton = () => {
const { logoutMutation } = useLogout();

return <S.LogoutButton onClick={() => logoutMutation()}>로그아웃</S.LogoutButton>;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add error handling for logout mutation.

The component currently doesn't handle potential errors from the logout mutation. Consider adding error states or loading indicators to improve user experience.

 const LogoutButton = () => {
-  const { logoutMutation } = useLogout();
+  const { logoutMutation, isLoading, error } = useLogout();

-  return <S.LogoutButton onClick={() => logoutMutation()}>로그아웃</S.LogoutButton>;
+  return (
+    <S.LogoutButton 
+      onClick={() => logoutMutation()} 
+      disabled={isLoading}
+    >
+      {isLoading ? '로그아웃 중...' : '로그아웃'}
+    </S.LogoutButton>
+  );
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const LogoutButton = () => {
const { logoutMutation } = useLogout();
return <S.LogoutButton onClick={() => logoutMutation()}>로그아웃</S.LogoutButton>;
};
const LogoutButton = () => {
const { logoutMutation, isLoading, error } = useLogout();
return (
<S.LogoutButton
onClick={() => logoutMutation()}
disabled={isLoading}
>
{isLoading ? '로그아웃 중...' : '로그아웃'}
</S.LogoutButton>
);
};
🤖 Prompt for AI Agents
In frontend/src/components/Button/LogoutButton/index.tsx around lines 4 to 8,
the logout mutation is called without handling errors or loading states. Update
the component to track the mutation's loading and error states, display a
loading indicator while the mutation is in progress, and show an error message
or feedback if the mutation fails. This will improve user experience by
providing clear feedback during logout attempts.

Comment on lines +6 to +18
const useLogout = () => {
const navigate = useNavigate();

const { mutate: logoutMutation } = useMutation({
mutationFn: logout,
onSuccess: () => {
localStorage.removeItem('accessToken');
navigate('/landing');
},
});

return { logoutMutation };
};
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance hook to return loading and error states.

The hook currently only returns the mutation function. Consider returning loading and error states to improve the user experience in consuming components.

 const useLogout = () => {
   const navigate = useNavigate();

-  const { mutate: logoutMutation } = useMutation({
+  const { mutate: logoutMutation, isPending, error } = useMutation({
     mutationFn: logout,
     onSuccess: () => {
       localStorage.removeItem('accessToken');
       navigate('/landing');
     },
   });

-  return { logoutMutation };
+  return { logoutMutation, isLoading: isPending, error };
 };

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In frontend/src/components/Button/LogoutButton/hooks/useLogout.ts between lines
6 and 18, the useLogout hook currently returns only the logoutMutation function.
To improve user experience, modify the hook to also return the loading and error
states from the useMutation hook. This involves destructuring isLoading and
error from the useMutation result and including them in the returned object
alongside logoutMutation.

Comment on lines +11 to +13
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix SVG attribute naming to prevent React console warnings.

The SVG stroke attributes are using kebab-case format, which will cause React console warnings. They should be converted to camelCase format.

Apply this diff to fix the attribute naming:

-        stroke-width="1.5"
-        stroke-linecap="round"
-        stroke-linejoin="round"
+        strokeWidth="1.5"
+        strokeLinecap="round"
+        strokeLinejoin="round"
-        stroke-width="1.5"
-        stroke-linecap="round"
-        stroke-linejoin="round"
+        strokeWidth="1.5"
+        strokeLinecap="round"
+        strokeLinejoin="round"

Also applies to: 18-20

🤖 Prompt for AI Agents
In frontend/src/components/Icon/icons/Pin.tsx around lines 11 to 13 and also
lines 18 to 20, the SVG stroke attributes use kebab-case (stroke-width,
stroke-linecap, stroke-linejoin) which causes React console warnings. Change
these attribute names to camelCase format: strokeWidth, strokeLinecap, and
strokeLinejoin to fix the warnings.

Comment on lines +11 to +13
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix SVG attribute naming to prevent React console warnings.

Same issue as in Pin.tsx - SVG stroke attributes are using kebab-case format which will cause React console warnings.

Apply this diff to fix the attribute naming:

-        stroke-width="1.5"
-        stroke-linecap="round"
-        stroke-linejoin="round"
+        strokeWidth="1.5"
+        strokeLinecap="round"
+        strokeLinejoin="round"
-        stroke-width="1.5"
-        stroke-linecap="round"
-        stroke-linejoin="round"
+        strokeWidth="1.5"
+        strokeLinecap="round"
+        strokeLinejoin="round"

Also applies to: 18-20

🤖 Prompt for AI Agents
In frontend/src/components/Icon/icons/Chart.tsx around lines 11 to 13 and 18 to
20, the SVG attributes stroke-width, stroke-linecap, and stroke-linejoin are
using kebab-case which causes React console warnings. Change these attribute
names to camelCase: strokeWidth, strokeLinecap, and strokeLinejoin respectively
to fix the warnings.

Comment on lines +11 to +13
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix SVG attribute naming to prevent React console warnings.

Same issue as in other icon components - SVG stroke attributes are using kebab-case format which will cause React console warnings.

Apply this diff to fix the attribute naming:

-        stroke-width="1.5"
-        stroke-linecap="round"
-        stroke-linejoin="round"
+        strokeWidth="1.5"
+        strokeLinecap="round"
+        strokeLinejoin="round"
-        stroke-width="1.5"
-        stroke-linecap="round"
-        stroke-linejoin="round"
+        strokeWidth="1.5"
+        strokeLinecap="round"
+        strokeLinejoin="round"

Also applies to: 18-20

🤖 Prompt for AI Agents
In frontend/src/components/Icon/icons/User.tsx between lines 11-13 and 18-20,
the SVG attributes stroke-width, stroke-linecap, and stroke-linejoin are using
kebab-case which causes React console warnings. Rename these attributes to
camelCase as strokeWidth, strokeLinecap, and strokeLinejoin respectively to fix
the warnings.

Comment on lines +30 to 51
export const DrawerContent = styled.div<{ $isOpen: boolean }>`
position: absolute;
top: 0;
right: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
width: 50%;
width: 26rem;
height: 100%;
padding: 2rem 0;
padding: 2rem 0 3rem 0;
background-color: ${({ theme }) => theme.colors.white};
border-radius: 0 0 0 3.2rem;
display: flex;
flex-direction: column;
gap: 1rem;
transform: translateX(${({ $isOpen }) => ($isOpen ? '0' : '100%')});
transition: transform 0.3s ease-in-out;
will-change: transform;
`;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix duplicate flexbox properties.

The component has duplicate display: flex and flex-direction: column declarations (lines 34-36 and 45-46). Also, consider the responsiveness of the fixed width.

 export const DrawerContent = styled.div<{ $isOpen: boolean }>`
   position: absolute;
   top: 0;
   right: 0;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
 
   width: 26rem;
   height: 100%;
   padding: 2rem 0 3rem 0;
 
   background-color: ${({ theme }) => theme.colors.white};
   border-radius: 0 0 0 3.2rem;
 
-  display: flex;
-  flex-direction: column;
 
   transform: translateX(${({ $isOpen }) => ($isOpen ? '0' : '100%')});
   transition: transform 0.3s ease-in-out;
   will-change: transform;
 `;

Consider making the width responsive for better mobile experience:

-  width: 26rem;
+  width: min(26rem, 90vw);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const DrawerContent = styled.div<{ $isOpen: boolean }>`
position: absolute;
top: 0;
right: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
width: 50%;
width: 26rem;
height: 100%;
padding: 2rem 0;
padding: 2rem 0 3rem 0;
background-color: ${({ theme }) => theme.colors.white};
border-radius: 0 0 0 3.2rem;
display: flex;
flex-direction: column;
gap: 1rem;
transform: translateX(${({ $isOpen }) => ($isOpen ? '0' : '100%')});
transition: transform 0.3s ease-in-out;
will-change: transform;
`;
export const DrawerContent = styled.div<{ $isOpen: boolean }>`
position: absolute;
top: 0;
right: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
- width: 26rem;
+ width: min(26rem, 90vw);
height: 100%;
padding: 2rem 0 3rem 0;
background-color: ${({ theme }) => theme.colors.white};
border-radius: 0 0 0 3.2rem;
- display: flex;
- flex-direction: column;
transform: translateX(${({ $isOpen }) => ($isOpen ? '0' : '100%')});
transition: transform 0.3s ease-in-out;
will-change: transform;
`;
🤖 Prompt for AI Agents
In frontend/src/components/Drawer/Drawer.styled.ts between lines 30 and 51,
remove the duplicate CSS properties 'display: flex' and 'flex-direction: column'
that appear twice. Keep only one set of these declarations to clean up the code.
Additionally, replace the fixed width of 26rem with a responsive width using
relative units or media queries to improve mobile responsiveness.

@young-jin-son young-jin-son merged commit 36f695b into develop Jul 15, 2025
3 checks passed
@young-jin-son young-jin-son deleted the feat/#290 branch July 15, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FE 프론트엔드 작업 feat 새로운 기능 구현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 로그아웃 기능 구현 및 설문 링크 추가

2 participants