-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] 로그아웃 기능 구현 및 설문 링크 추가 #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis 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
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
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
Assessment against linked issues
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 linkAdd 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
📒 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 infrontend/src/components/Icon/iconsand each declares a properexport 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 RequiredBoth
https://tally.so/r/n0grZ9andhttps://pf.kakao.com/_eKSJnreturn 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
DrawerMenuand 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
DrawerMenucomponent and addition of the footer section with feedback components creates a cleaner, more maintainable structure. TheDrawerFooterSectionprovides 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
OverlaytoDrawerOverlayimproves clarity and maintains consistent naming conventions with the "Drawer" prefix.
53-61: LGTM: Well-structured header components.The new
DrawerHeaderSectionandDrawerLogocomponents provide better semantic structure and appropriate spacing for the drawer header.
63-100: LGTM: Consistent navigation component naming.The renaming from
MenuList/MenuItemtoDrawerNavigationList/DrawerNavigationItemmaintains consistency with the "Drawer" prefix and improves semantic clarity.
102-113: LGTM: Well-styled feedback prompt component.The
DrawerFeedbackPromptcomponent 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.
| // 로그아웃 | ||
| logout: `${BASE_URL}/api/v1/auth/logout`, | ||
|
|
There was a problem hiding this comment.
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.
| <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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| <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.
| <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" | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| <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.
| export const logout = async () => { | ||
| const result = await fetchClient.post(API_URL.logout); | ||
|
|
||
| return result; | ||
| }; |
There was a problem hiding this comment.
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.
| 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.
| const LogoutButton = () => { | ||
| const { logoutMutation } = useLogout(); | ||
|
|
||
| return <S.LogoutButton onClick={() => logoutMutation()}>로그아웃</S.LogoutButton>; | ||
| }; |
There was a problem hiding this comment.
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.
| 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.
| const useLogout = () => { | ||
| const navigate = useNavigate(); | ||
|
|
||
| const { mutate: logoutMutation } = useMutation({ | ||
| mutationFn: logout, | ||
| onSuccess: () => { | ||
| localStorage.removeItem('accessToken'); | ||
| navigate('/landing'); | ||
| }, | ||
| }); | ||
|
|
||
| return { logoutMutation }; | ||
| }; |
There was a problem hiding this comment.
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.
| stroke-width="1.5" | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| stroke-width="1.5" | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| stroke-width="1.5" | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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; | ||
| `; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
Issue Number
close #290
As-Is
To-Be
Check List
Test Screenshot
(Optional) Additional Description
Summary by CodeRabbit
New Features
Improvements