-
Notifications
You must be signed in to change notification settings - Fork 47
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
(apps-web)[fix]: Center Dashboard Data on Toggle FullWidth Mode #3371
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe changes in this pull request primarily involve modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
warning @next/eslint-plugin-next > [email protected]: Glob versions prior to v9 are no longer supported Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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: 0
🧹 Outside diff range and nitpick comments (2)
apps/web/app/[locale]/page-component.tsx (2)
Line range hint
64-67
: Optimize fullWidth state initializationThe current implementation can be improved for better reliability and efficiency.
Consider this improved implementation:
React.useEffect(() => { - window && window?.localStorage.getItem('conf-fullWidth-mode'); - setFullWidth(JSON.parse(window?.localStorage.getItem('conf-fullWidth-mode') || 'true')); + try { + const stored = localStorage.getItem('conf-fullWidth-mode'); + setFullWidth(stored ? JSON.parse(stored) : true); + } catch (error) { + console.error('Error loading fullWidth mode:', error); + setFullWidth(true); + } }, [setFullWidth]);
101-105
: Fix indentation in conditional renderingThe JSX indentation is inconsistent, making the code harder to read.
Consider this formatting:
- <div className="h-full ">{isTeamMember ? - <Container fullWidth={fullWidth} className='mx-auto' > - <TeamMembers kanbanView={view} /> - </Container> - : <NoTeam />}</div> + <div className="h-full"> + {isTeamMember ? ( + <Container fullWidth={fullWidth} className="mx-auto"> + <TeamMembers kanbanView={view} /> + </Container> + ) : ( + <NoTeam /> + )} + </div>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
apps/web/app/[locale]/page-component.tsx
(2 hunks)
🔇 Additional comments (2)
apps/web/app/[locale]/page-component.tsx (2)
9-9
: LGTM: Clean import addition
The Container import is appropriately grouped with related components.
101-105
: LGTM: Proper implementation of centered layout
The Container implementation correctly addresses the centering issue in FullWidth mode:
- Uses Container component for consistent layout management
- Properly passes fullWidth state
- Applies mx-auto for horizontal centering
Description
Fix #3370
Type of Change
Checklist
Previous screenshots
Screen.Recording.2024-11-26.at.7.07.28.AM.mov
Current screenshots
Screen.Recording.2024-11-26.at.07.58.36.mov
Summary by CodeRabbit
New Features
Bug Fixes