[PageContainer] Allow full-size content#4480
[PageContainer] Allow full-size content#4480apedroferreira merged 16 commits intomui:masterfrom apedroferreira:full-size-page-container
Conversation
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "props": {}, | |||
| "props": { "children": { "type": { "name": "node" } } }, | |||
There was a problem hiding this comment.
Proptypes are now being generated for the components which don't match the name of the folder (secondary components), I think that should be a good thing?
Changed it in the script that generates proptypes so that the API documentation for PageHeader would be there, auto-generated.
| } | ||
|
|
||
| return fileName === folderName; | ||
| return !fileName.endsWith('.test'); |
There was a problem hiding this comment.
Generates proptypes for all non-test files inside the folder of each component.
There was a problem hiding this comment.
This is also generating proptypes for components marked as @ignore in the JSDoc comments - something to fix?
There was a problem hiding this comment.
I guess we can try to exclude them if it's easy to do.
done!
|
Looks like the CI is having out of memory issues again, we probably either need to manage dependencies to stay under or increase instance sizes? |
Yes, although I'm wondering what exactly triggered the CI out of memory issues |
docs/data/toolpad/core/components/page-container/page-container.md
Outdated
Show resolved
Hide resolved
docs/data/toolpad/core/components/page-container/PageContainerHeader.tsx
Outdated
Show resolved
Hide resolved
…r.md Co-authored-by: Bharat Kashyap <[email protected]> Signed-off-by: Pedro Ferreira <[email protected]>
bharatkashyap
left a comment
There was a problem hiding this comment.
On second thought:
Apart from standalone usage, should we make the PageHeader composable inside the PageContainer as well? Just as we made the ThemeSwitcher composable inside ToolbarActions?
Something like
<PageContainer>
<PageHeader slots={{toolbar: CustomToolbar}} />
{children}
</PageContainer>This way, we could also move the toolbar slot to PageHeader, which better reflects its position anyway.
Wdyt? I know it's a tangential part of this PR, so feel free to extract the rest if this feels too blocking
Sounds like a probably good idea, we can discuss it just to make sure. |
I feel we can enforce a migration now to a composable API and remove the <PageContainer>
+ <PageHeader>
+ <PageHeaderBreadcrumbs /> // would contain the default breadcrumbs
+ <PageHeaderToolbar> ... </PageHeaderToolbar>// (optional, this would replace the `toolbar` slot)
+ </PageHeader>
{children}
</PageContainer>to all uses of We can discuss this tomorrow or in next week's grooming 👍🏻 |
|
What would be the difference between PageContainer and
what would be the difference between the PageContainer and a @mui/material Container? Wouldn't it be enough to just build a PageHeader component? |
One of the main advantages of using Toolpad is that it does standard things for you with little code. I feel like if we separate the container into too many sub-components that usually need to be used it kind of complicates things. I prefer the approach where we provide a few components and more detailed customization can be made with slots.
Not a lot right now, but at the moment the It seems like these wouldn't be difficult to do with a standard |
|
As discussed, the Also, as a global discussion, we can start considering a more composable API for customization with different sub-components as opposed to slots in some cases at least. |
bharatkashyap
left a comment
There was a problem hiding this comment.
Looks good! We should make sure to mark this as a breaking change in the release notes
docs/data/toolpad/core/components/page-container/ActionsPageContainer.js
Outdated
Show resolved
Hide resolved
docs/data/toolpad/core/components/page-container/ActionsPageContainer.tsx
Outdated
Show resolved
Hide resolved
…ntainer.tsx Co-authored-by: Bharat Kashyap <[email protected]> Signed-off-by: Pedro Ferreira <[email protected]>
…ntainer.js Co-authored-by: Bharat Kashyap <[email protected]> Signed-off-by: Pedro Ferreira <[email protected]>
Closes #4324
Closes #4072
Needed it already in the CRUD for the list table to take up the full space in the layout.
As per the discussion in #4324:
PageContainerwithflex: 1orheight: 100%.sxprop toPageContainer.PageHeaderfromPageContainerto optionally be used as a standalone componenthttps://deploy-preview-4480--mui-toolpad-docs.netlify.app/toolpad/core/react-page-container
BREAKING CHANGE:
toolbarslot was moved toPageHeadercomponent which can be configured with theheaderslot inPageContainer. Updated examples in docs to reflect this. It should just be a step towards separating the components as proposed in #4525.