Skip to content
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

[core] Allow changing the width of the drawer in dashboard layout component #4266

Open
prakhargupta1 opened this issue Oct 16, 2024 · 5 comments
Assignees
Labels

Comments

@prakhargupta1
Copy link
Member

prakhargupta1 commented Oct 16, 2024

Summary

User request: https://discord.com/channels/1131323012554174485/1295843734969122866

Search keywords: drawer

@prakhargupta1 prakhargupta1 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 16, 2024
@Janpot Janpot added component: DashboardLayout new feature New feature or request and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 18, 2024
@Janpot
Copy link
Member

Janpot commented Oct 18, 2024

Should we support resizing as well? Could be a pro feature even.

@apedroferreira
Copy link
Member

Should we support resizing as well? Could be a pro feature even.

We could, but not sure if anyone would really want to be able to resize?

About this feature, I guess we can allow it through the sx prop if possible, or provide a specific prop to set a width, I'll give it a try to decide what's best.

@garryxiao
Copy link

I checked the code, add a new property like 'drawerWidth' to DashboardLayoutProps would help.
drawerWidth?: number | ((isMini: boolean) => number)
const drawerWidth = typeof drawerWidth === 'function' ? drawerWidth(isMini) : isMini ? 64 : drawerWidth ?? 320;

@apedroferreira
Copy link
Member

apedroferreira commented Oct 21, 2024

I checked the code, add a new property like 'drawerWidth' to DashboardLayoutProps would help. drawerWidth?: number | ((isMini: boolean) => number) const drawerWidth = typeof drawerWidth === 'function' ? drawerWidth(isMini) : isMini ? 64 : drawerWidth ?? 320;

Something like that sounds like probably the best approach!
Feel free to open a PR with something like a sidebarExpandedWidth prop that simply takes a number in pixels and defaults to 320, or I can get to it eventually :)
I think we can keep the mini variant width at a constant 64px to keep it simple for now (no function needed).

@garryxiao
Copy link

Yes I agree. The mini variant width is not only for the icons, also decide the top left width. I leared to make the changes. Any issues please fix for me. Thanks.
PR: #4296

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

No branches or pull requests

4 participants