Skip to content

Commit

Permalink
Hide layout header and sidebar when printing (#4334)
Browse files Browse the repository at this point in the history
  • Loading branch information
apedroferreira authored Oct 31, 2024
1 parent de4ac6c commit 887a2ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/toolpad-core/src/DashboardLayout/DashboardLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ function DashboardLayout(props: DashboardLayoutProps) {
const drawerWidth = isMini ? 64 : sidebarExpandedWidth;

return {
displayPrint: 'none',
width: drawerWidth,
flexShrink: 0,
...getDrawerWidthTransitionMixin(isNavigationExpanded),
Expand Down Expand Up @@ -325,7 +326,7 @@ function DashboardLayout(props: DashboardLayoutProps) {
...sx,
}}
>
<AppBar color="inherit" position="absolute">
<AppBar color="inherit" position="absolute" sx={{ displayPrint: 'none' }}>
<Toolbar sx={{ backgroundColor: 'inherit', mx: { xs: -0.75, sm: -1.5 } }}>
{!hideNavigation ? (
<React.Fragment>
Expand Down Expand Up @@ -434,7 +435,7 @@ function DashboardLayout(props: DashboardLayoutProps) {
flex: 1,
}}
>
<Toolbar />
<Toolbar sx={{ displayPrint: 'none' }} />
<Box
component="main"
sx={{
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 887a2ba

Please sign in to comment.