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

Closed
prakhargupta1 opened this issue Oct 16, 2024 · 6 comments · Fixed by #4296
Closed

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

prakhargupta1 opened this issue Oct 16, 2024 · 6 comments · Fixed by #4296
Assignees
Labels
component: layout This is the name of the generic UI component, not the React module! new feature New feature or request

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
Contributor

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
Contributor

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

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@oliviertassinari oliviertassinari added component: layout This is the name of the generic UI component, not the React module! and removed component: DashboardLayout labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: layout This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

5 participants