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] Make DashboardLayout navigation responsive #3750

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
739e913
Make DashboardLayout navigation responsive
apedroferreira Jul 3, 2024
5657f06
Simplify
apedroferreira Jul 3, 2024
cb290e4
Naming adjustments
apedroferreira Jul 3, 2024
0ec086f
Merge remote-tracking branch 'upstream/master' into dashboard-layout-…
apedroferreira Jul 3, 2024
08df769
Fix dashboard layout tests
apedroferreira Jul 3, 2024
9b6c268
Better like this
apedroferreira Jul 3, 2024
aaaf110
Wording
apedroferreira Jul 3, 2024
f88ad84
Set larger viewport dimensions for browser tests
apedroferreira Jul 3, 2024
00f187f
Review improvements/fixes + center logo and title better
apedroferreira Jul 5, 2024
5266f4d
Set min page content width
apedroferreira Jul 5, 2024
4a8563f
Merge remote-tracking branch 'upstream/master' into dashboard-layout-…
apedroferreira Jul 5, 2024
0f16640
More review feedback: make demo prop internal and make mobile breakpo…
apedroferreira Jul 8, 2024
ceb8cb7
Merge branch 'master' into dashboard-layout-responsive-nav
apedroferreira Jul 8, 2024
c18db83
Attempt to set breakpoints with theme but doesn't do anything so far...
apedroferreira Jul 10, 2024
b6297dc
Use theme with breakpoints in docs demos
apedroferreira Jul 10, 2024
a7c311e
Revert back to temporary navigation on mobile
apedroferreira Jul 10, 2024
eb22409
More mobile fixes
apedroferreira Jul 10, 2024
accb7ce
Add solution for responsive drawer in docs but needs an internal prop…
apedroferreira Jul 10, 2024
296d37a
Rename prop
apedroferreira Jul 10, 2024
a2089c9
Add container hack to all docs examples that use DashboardLayout
apedroferreira Jul 11, 2024
1b84d85
Make DashboardLayout have a public container prop instead
apedroferreira Jul 11, 2024
6efc05d
Fix menu closing in nested items
apedroferreira Jul 16, 2024
adf49df
Revert unwanted playground changes
apedroferreira Jul 16, 2024
3080479
Prettier wasn't working for some reason
apedroferreira Jul 16, 2024
b611de7
Merge remote-tracking branch 'upstream/master' into dashboard-layout-…
apedroferreira Jul 16, 2024
53e33ce
Merge remote-tracking branch 'upstream/master' into dashboard-layout-…
apedroferreira Jul 19, 2024
5ddc2aa
Just need to fix mobile sidebar color somehow
apedroferreira Jul 19, 2024
056e997
Fix drawer color
apedroferreira Jul 19, 2024
1c1e932
Adjustments
apedroferreira Jul 19, 2024
1cc6535
Fix colors
apedroferreira Jul 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { extendTheme } from '@mui/material/styles';
import DashboardIcon from '@mui/icons-material/Dashboard';
import TimelineIcon from '@mui/icons-material/Timeline';
import { AppProvider } from '@toolpad/core/AppProvider';
Expand All @@ -24,6 +25,18 @@ const NAVIGATION = [
},
];

const demoTheme = extendTheme({
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }) {
return (
<Box
Expand Down Expand Up @@ -62,7 +75,12 @@ function AppProviderBasic(props) {

return (
// preview-start
<AppProvider navigation={NAVIGATION} router={router} window={demoWindow}>
<AppProvider
navigation={NAVIGATION}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
<DemoPageContent pathname={pathname} />
</DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { extendTheme } from '@mui/material/styles';
import DashboardIcon from '@mui/icons-material/Dashboard';
import TimelineIcon from '@mui/icons-material/Timeline';
import { AppProvider } from '@toolpad/core/AppProvider';
Expand All @@ -24,6 +25,18 @@ const NAVIGATION: Navigation = [
},
];

const demoTheme = extendTheme({
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }: { pathname: string }) {
return (
<Box
Expand Down Expand Up @@ -66,7 +79,12 @@ export default function AppProviderBasic(props: DemoProps) {

return (
// preview-start
<AppProvider navigation={NAVIGATION} router={router} window={demoWindow}>
<AppProvider
navigation={NAVIGATION}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
<DemoPageContent pathname={pathname} />
</DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<AppProvider navigation={NAVIGATION} router={router} window={demoWindow}>
<AppProvider
navigation={NAVIGATION}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
<DemoPageContent pathname={pathname} />
</DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ const customTheme = extendTheme({
},
},
},
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ const customTheme = extendTheme({
},
},
},
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }: { pathname: string }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { extendTheme } from '@mui/material/styles';
import DashboardIcon from '@mui/icons-material/Dashboard';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
import BarChartIcon from '@mui/icons-material/BarChart';
Expand Down Expand Up @@ -56,6 +57,18 @@ const NAVIGATION = [
},
];

const demoTheme = extendTheme({
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }) {
return (
<Box
Expand Down Expand Up @@ -94,7 +107,12 @@ function DashboardLayoutBasic(props) {

return (
// preview-start
<AppProvider navigation={NAVIGATION} router={router} window={demoWindow}>
<AppProvider
navigation={NAVIGATION}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
<DemoPageContent pathname={pathname} />
</DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { extendTheme } from '@mui/material/styles';
import DashboardIcon from '@mui/icons-material/Dashboard';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
import BarChartIcon from '@mui/icons-material/BarChart';
Expand Down Expand Up @@ -56,6 +57,18 @@ const NAVIGATION: Navigation = [
},
];

const demoTheme = extendTheme({
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }: { pathname: string }) {
return (
<Box
Expand Down Expand Up @@ -98,7 +111,12 @@ export default function DashboardLayoutBasic(props: DemoProps) {

return (
// preview-start
<AppProvider navigation={NAVIGATION} router={router} window={demoWindow}>
<AppProvider
navigation={NAVIGATION}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
<DemoPageContent pathname={pathname} />
</DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<AppProvider navigation={NAVIGATION} router={router} window={demoWindow}>
<AppProvider
navigation={NAVIGATION}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
<DemoPageContent pathname={pathname} />
</DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { extendTheme } from '@mui/material/styles';
import DashboardIcon from '@mui/icons-material/Dashboard';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
import { AppProvider } from '@toolpad/core/AppProvider';
Expand All @@ -20,6 +21,18 @@ const NAVIGATION = [
},
];

const demoTheme = extendTheme({
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }) {
return (
<Box
Expand Down Expand Up @@ -65,6 +78,7 @@ function DashboardLayoutBranding(props) {
title: 'MUI',
}}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { extendTheme } from '@mui/material/styles';
import DashboardIcon from '@mui/icons-material/Dashboard';
import ShoppingCartIcon from '@mui/icons-material/ShoppingCart';
import { AppProvider, Router } from '@toolpad/core/AppProvider';
Expand All @@ -20,6 +21,18 @@ const NAVIGATION: Navigation = [
},
];

const demoTheme = extendTheme({
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }: { pathname: string }) {
return (
<Box
Expand Down Expand Up @@ -69,6 +82,7 @@ export default function DashboardLayoutBranding(props: DemoProps) {
title: 'MUI',
}}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
title: 'MUI',
}}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { extendTheme } from '@mui/material/styles';
import DescriptionIcon from '@mui/icons-material/Description';
import FolderIcon from '@mui/icons-material/Folder';
import { AppProvider } from '@toolpad/core/AppProvider';
import { DashboardLayout } from '@toolpad/core/DashboardLayout';

const demoTheme = extendTheme({
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }) {
return (
<Box
Expand Down Expand Up @@ -187,6 +200,7 @@ function DashboardLayoutNavigation(props) {
},
]}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography';
import { extendTheme } from '@mui/material/styles';
import DescriptionIcon from '@mui/icons-material/Description';
import FolderIcon from '@mui/icons-material/Folder';
import { AppProvider, Router } from '@toolpad/core/AppProvider';
import { DashboardLayout } from '@toolpad/core/DashboardLayout';

const demoTheme = extendTheme({
breakpoints: {
values: {
xs: 0,
sm: 600,
md: 600,
lg: 1200,
xl: 1536,
},
},
});

function DemoPageContent({ pathname }: { pathname: string }) {
return (
<Box
Expand Down Expand Up @@ -190,6 +203,7 @@ export default function DashboardLayoutNavigation(props: DemoProps) {
},
]}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
},
]}
router={router}
theme={demoTheme}
window={demoWindow}
>
<DashboardLayout>
Expand Down
Loading
Loading