-
Notifications
You must be signed in to change notification settings - Fork 263
refactor: move logout to accountPageItems
and reduce code duplication
#4481
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
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.
Pull Request Overview
This PR refactors the logout functionality by moving it into accountPageItems to reduce duplicated code in the profile settings menu.
- Consolidates logout into accountPageItems.
- Removes the separate mobile-specific logout block.
- Adjusts the use of separators in the menu list based on item order.
Comments suppressed due to low confidence (1)
packages/shared/src/components/profile/ProfileSettingsMenu.tsx:239
- [nitpick] The removal of the mobile-specific typography override for the logout item may affect the mobile UX. Confirm that the mobile styling has been addressed elsewhere or add appropriate styling if needed.
- <ProfileSection
- items={[
- {
- title: 'Log out',
- icon: ExitIcon,
- onClick: () => logout(LogoutReason.ManualLogout),
- ...(isMobile && {
- typography: {
- type: TypographyType.Body,
- color: TypographyColor.Primary,
- },
- }),
- },
- ]}
- />
logout: { | ||
title: 'Log out', | ||
icon: ExitIcon, | ||
onClick: () => logout(LogoutReason.ManualLogout), |
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.
logout
from AuthContext
is the same as the one from useAuthContext
(latter just sets it in its context 🙈)
Changes
Moves the logout section into
accountPageItems
and reduce code duplicationPreview domain
https://refactor-simplify-settings-menu.preview.app.daily.dev