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 com… #4296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

garryxiao
Copy link

No description provided.

Copy link
Member

@apedroferreira apedroferreira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!
Can you also please autogenerate the documentation for the new prop?

You should be able to do it by running 2 scripts from the root package after addressing the comments below.

  1. pnpm proptypes
  2. pnpm docs:build:api

And then just add and commit the autogenerated changes!

@@ -89,6 +89,10 @@ export interface DashboardLayoutProps {
* @default false
*/
hideNavigation?: boolean;
/**
* The width in pixel of the sidebar when expanded, default value is 320.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The width in pixel of the sidebar when expanded, default value is 320.
* Width of the sidebar when expanded, in pixels.
* @default 320

@@ -286,7 +291,7 @@ function DashboardLayout(props: DashboardLayoutProps) {

const getDrawerSharedSx = React.useCallback(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this getDrawerSharedSx callback, sidebarExpandedWidth also needs to be added at the end to the dependencies array.
The react-hooks/exhaustive-deps eslint rule should automatically show you an error about this.

@apedroferreira apedroferreira self-assigned this Oct 22, 2024
@apedroferreira apedroferreira added component: DashboardLayout enhancement This is not a bug, nor a new feature labels Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: DashboardLayout enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants