enhanced the app bar collapse feature #1840
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Fixes:
Checklist before requesting a review
Pull Request: Sidebar Collapse State with Recoil and Dynamic Layout
Summary of Changes
Introduced a Recoil atom (isSideBarCollapsed) to manage the sidebar’s collapsed state globally.
Updated Appbar to use useRecoilState for toggling the sidebar collapse state on button click.
Updated Layout to use useRecoilValue to listen to the sidebar’s collapse state and dynamically adjust the main layout’s margin.
Wrapped the entire app with RecoilRoot in RootLayout to provide Recoil state management.
Ensured smooth transitions for layout adjustments using Tailwind’s transition-all and duration-300.
Impact
Allows consistent sidebar collapse state across the app.
Enables dynamic layout adjustment (main content shifting) based on the sidebar state.
Sets up the groundwork for future state sharing across components using Recoil.
Testing Steps
Run the app.
-Click the sidebar toggle button to collapse/expand the sidebar.
-Observe the main content area shifting dynamically (e.g., from ml-[21vw] to ml-[5vw] and back).
-Confirm that state management persists as expected across components.
2025-05-24.12-58-44.mp4