Skip to content

Commit

Permalink
fix prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
vikasgurjar committed Dec 6, 2024
1 parent d807097 commit 29cdab0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ function DemoPageContent({ pathname, toggleSidebar }) {
DemoPageContent.propTypes = {
pathname: PropTypes.string.isRequired,
toggleSidebar: PropTypes.shape({
'__@hasInstance@2351': PropTypes.func.isRequired,
'__@metadata@2353': PropTypes.any,
'__@hasInstance@2077': PropTypes.func.isRequired,
'__@metadata@2079': PropTypes.any,
apply: PropTypes.func.isRequired,
arguments: PropTypes.any.isRequired,
bind: PropTypes.func.isRequired,
Expand Down
7 changes: 1 addition & 6 deletions docs/pages/toolpad/core/api/dashboard-layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
"defaultSidebarCollapsed": { "type": { "name": "bool" }, "default": "false" },
"disableCollapsibleSidebar": { "type": { "name": "bool" }, "default": "false" },
"hideNavigation": { "type": { "name": "bool" }, "default": "false" },
"onToggleSidebar": {
"type": {
"name": "shape",
"description": "{ __@hasInstance@2070: func, apply: func, arguments: any, bind: func, call: func, caller: object, length: number, name: string, prototype: any, toString: func }"
}
},
"onToggleSidebar": { "type": { "name": "func" } },
"sidebarCollapsed": { "type": { "name": "bool" }, "default": "false" },
"sidebarExpandedWidth": {
"type": { "name": "union", "description": "number<br>&#124;&nbsp;string" },
Expand Down
15 changes: 2 additions & 13 deletions packages/toolpad-core/src/DashboardLayout/DashboardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export interface DashboardLayoutProps {
/**
* Callback function to be executed on sidebarCollased state change
*/
onToggleSidebar?: Function;
onToggleSidebar?: (sidebarCollapsed: boolean) => undefined;
/**
* Width of the sidebar when expanded.
* @default 320
Expand Down Expand Up @@ -493,18 +493,7 @@ DashboardLayout.propTypes /* remove-proptypes */ = {
/**
* Callback function to be executed on sidebarCollased state change
*/
onToggleSidebar: PropTypes.shape({
'__@hasInstance@2070': PropTypes.func.isRequired,
apply: PropTypes.func.isRequired,
arguments: PropTypes.any.isRequired,
bind: PropTypes.func.isRequired,
call: PropTypes.func.isRequired,
caller: PropTypes.object.isRequired,
length: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
prototype: PropTypes.any.isRequired,
toString: PropTypes.func.isRequired,
}),
onToggleSidebar: PropTypes.func,
/**
* A prop that controls the collapsed state of the sidebar.
* @default false
Expand Down

0 comments on commit 29cdab0

Please sign in to comment.