-
-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PageContainer] Allow full-size content (#4480)
Signed-off-by: Pedro Ferreira <10789765+apedroferreira@users.noreply.github.com> Co-authored-by: Bharat Kashyap <bharatkashyap@outlook.com>
- Loading branch information
1 parent
f65ef9c
commit 46a3e8c
Showing
43 changed files
with
766 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
docs/data/toolpad/core/components/page-container/PageContainerFullScreen.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import * as React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { createTheme } from '@mui/material/styles'; | ||
import MapIcon from '@mui/icons-material/Map'; | ||
import { AppProvider } from '@toolpad/core/AppProvider'; | ||
import { DashboardLayout } from '@toolpad/core/DashboardLayout'; | ||
import { PageContainer } from '@toolpad/core/PageContainer'; | ||
import { useDemoRouter } from '@toolpad/core/internal'; | ||
|
||
const NAVIGATION = [ | ||
{ | ||
segment: 'map', | ||
title: 'Map', | ||
icon: <MapIcon />, | ||
}, | ||
]; | ||
|
||
const demoTheme = createTheme({ | ||
cssVariables: { | ||
colorSchemeSelector: 'data-toolpad-color-scheme', | ||
}, | ||
colorSchemes: { light: true, dark: true }, | ||
breakpoints: { | ||
values: { | ||
xs: 0, | ||
sm: 600, | ||
md: 600, | ||
lg: 1200, | ||
xl: 1536, | ||
}, | ||
}, | ||
}); | ||
|
||
function PageContainerFullScreen(props) { | ||
const { window } = props; | ||
|
||
const router = useDemoRouter('/map'); | ||
|
||
// Remove this const when copying and pasting into your project. | ||
const demoWindow = window !== undefined ? window() : undefined; | ||
|
||
return ( | ||
<AppProvider | ||
navigation={NAVIGATION} | ||
router={router} | ||
theme={demoTheme} | ||
window={demoWindow} | ||
> | ||
<DashboardLayout defaultSidebarCollapsed> | ||
<PageContainer> | ||
<iframe | ||
title="Google Map" | ||
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d387190.2799181496!2d-74.25987571760744!3d40.69767006358627!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c259af18b60165%3A0x8b621f8a7a7d28a4!2sNew%20York%2C%20NY%2C%20USA!5e0!3m2!1sen!2s!4v1633452834502!5m2!1sen!2s" | ||
style={{ flex: 1, border: 0 }} | ||
allowFullScreen | ||
loading="lazy" | ||
/> | ||
</PageContainer> | ||
</DashboardLayout> | ||
</AppProvider> | ||
); | ||
} | ||
|
||
PageContainerFullScreen.propTypes = { | ||
/** | ||
* Injected by the documentation to work in an iframe. | ||
* Remove this when copying and pasting into your project. | ||
*/ | ||
window: PropTypes.func, | ||
}; | ||
|
||
export default PageContainerFullScreen; |
69 changes: 69 additions & 0 deletions
69
docs/data/toolpad/core/components/page-container/PageContainerFullScreen.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import * as React from 'react'; | ||
import { createTheme } from '@mui/material/styles'; | ||
import MapIcon from '@mui/icons-material/Map'; | ||
import { AppProvider, type Navigation } from '@toolpad/core/AppProvider'; | ||
import { DashboardLayout } from '@toolpad/core/DashboardLayout'; | ||
import { PageContainer } from '@toolpad/core/PageContainer'; | ||
import { useDemoRouter } from '@toolpad/core/internal'; | ||
|
||
const NAVIGATION: Navigation = [ | ||
{ | ||
segment: 'map', | ||
title: 'Map', | ||
icon: <MapIcon />, | ||
}, | ||
]; | ||
|
||
const demoTheme = createTheme({ | ||
cssVariables: { | ||
colorSchemeSelector: 'data-toolpad-color-scheme', | ||
}, | ||
colorSchemes: { light: true, dark: true }, | ||
breakpoints: { | ||
values: { | ||
xs: 0, | ||
sm: 600, | ||
md: 600, | ||
lg: 1200, | ||
xl: 1536, | ||
}, | ||
}, | ||
}); | ||
|
||
interface DemoProps { | ||
/** | ||
* Injected by the documentation to work in an iframe. | ||
* Remove this when copying and pasting into your project. | ||
*/ | ||
window?: () => Window; | ||
} | ||
|
||
export default function PageContainerFullScreen(props: DemoProps) { | ||
const { window } = props; | ||
|
||
const router = useDemoRouter('/map'); | ||
|
||
// Remove this const when copying and pasting into your project. | ||
const demoWindow = window !== undefined ? window() : undefined; | ||
|
||
return ( | ||
<AppProvider | ||
navigation={NAVIGATION} | ||
router={router} | ||
theme={demoTheme} | ||
window={demoWindow} | ||
> | ||
<DashboardLayout defaultSidebarCollapsed> | ||
<PageContainer> | ||
<iframe | ||
title="Google Map" | ||
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d387190.2799181496!2d-74.25987571760744!3d40.69767006358627!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c259af18b60165%3A0x8b621f8a7a7d28a4!2sNew%20York%2C%20NY%2C%20USA!5e0!3m2!1sen!2s!4v1633452834502!5m2!1sen!2s" | ||
style={{ flex: 1, border: 0 }} | ||
allowFullScreen | ||
loading="lazy" | ||
/> | ||
</PageContainer> | ||
</DashboardLayout> | ||
</AppProvider> | ||
); | ||
} |
11 changes: 11 additions & 0 deletions
11
docs/data/toolpad/core/components/page-container/PageContainerFullScreen.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<DashboardLayout defaultSidebarCollapsed> | ||
<PageContainer> | ||
<iframe | ||
title="Google Map" | ||
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d387190.2799181496!2d-74.25987571760744!3d40.69767006358627!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c259af18b60165%3A0x8b621f8a7a7d28a4!2sNew%20York%2C%20NY%2C%20USA!5e0!3m2!1sen!2s!4v1633452834502!5m2!1sen!2s" | ||
style={{ flex: 1, border: 0 }} | ||
allowFullScreen | ||
loading="lazy" | ||
/> | ||
</PageContainer> | ||
</DashboardLayout> |
34 changes: 34 additions & 0 deletions
34
docs/data/toolpad/core/components/page-container/PageContainerHeader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import * as React from 'react'; | ||
// preview-start | ||
import { PageHeader } from '@toolpad/core/PageContainer'; | ||
// preview-end | ||
import { AppProvider } from '@toolpad/core/AppProvider'; | ||
import { useDemoRouter } from '@toolpad/core/internal'; | ||
import { useTheme } from '@mui/material/styles'; | ||
import Box from '@mui/material/Box'; | ||
import Container from '@mui/material/Container'; | ||
import Paper from '@mui/material/Paper'; | ||
|
||
const NAVIGATION = [ | ||
{ segment: '', title: 'Home' }, | ||
{ segment: 'orders', title: 'Orders' }, | ||
]; | ||
|
||
export default function PageContainerHeader() { | ||
const router = useDemoRouter('/orders'); | ||
|
||
const theme = useTheme(); | ||
|
||
return ( | ||
<AppProvider navigation={NAVIGATION} router={router} theme={theme}> | ||
<Paper sx={{ width: '100%' }}> | ||
{/* preview-start */} | ||
<Container sx={{ my: 2 }}> | ||
<PageHeader /> | ||
<Box sx={{ mt: 1 }}>Page content</Box> | ||
</Container> | ||
{/* preview-end */} | ||
</Paper> | ||
</AppProvider> | ||
); | ||
} |
34 changes: 34 additions & 0 deletions
34
docs/data/toolpad/core/components/page-container/PageContainerHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import * as React from 'react'; | ||
// preview-start | ||
import { PageHeader } from '@toolpad/core/PageContainer'; | ||
// preview-end | ||
import { AppProvider } from '@toolpad/core/AppProvider'; | ||
import { useDemoRouter } from '@toolpad/core/internal'; | ||
import { useTheme } from '@mui/material/styles'; | ||
import Box from '@mui/material/Box'; | ||
import Container from '@mui/material/Container'; | ||
import Paper from '@mui/material/Paper'; | ||
|
||
const NAVIGATION = [ | ||
{ segment: '', title: 'Home' }, | ||
{ segment: 'orders', title: 'Orders' }, | ||
]; | ||
|
||
export default function PageContainerHeader() { | ||
const router = useDemoRouter('/orders'); | ||
|
||
const theme = useTheme(); | ||
|
||
return ( | ||
<AppProvider navigation={NAVIGATION} router={router} theme={theme}> | ||
<Paper sx={{ width: '100%' }}> | ||
{/* preview-start */} | ||
<Container sx={{ my: 2 }}> | ||
<PageHeader /> | ||
<Box sx={{ mt: 1 }}>Page content</Box> | ||
</Container> | ||
{/* preview-end */} | ||
</Paper> | ||
</AppProvider> | ||
); | ||
} |
Oops, something went wrong.