Skip to content

enhanced the app bar collapse feature #1840

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Ashwin-Khowala
Copy link

@Ashwin-Khowala Ashwin-Khowala commented May 24, 2025

PR Fixes:

  • Implemented Recoil state for sidebar collapse and dynamic main layout margin.

Checklist before requesting a review

  • I have performed a self-review of my code
  • I assure there is no similar/duplicate pull request regarding same issue

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

@Ashwin-Khowala
Copy link
Author

@hkirat @devsargam pls check and let me know if something is wrong, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant