feat(dashboard): enhance layout styles and improve header navigation appearance
This commit is contained in:
@@ -10,5 +10,6 @@ export function dashboardLayoutVars(theme: Theme) {
|
|||||||
'--layout-dashboard-content-pt': theme.spacing(1),
|
'--layout-dashboard-content-pt': theme.spacing(1),
|
||||||
'--layout-dashboard-content-pb': theme.spacing(8),
|
'--layout-dashboard-content-pb': theme.spacing(8),
|
||||||
'--layout-dashboard-content-px': theme.spacing(5),
|
'--layout-dashboard-content-px': theme.spacing(5),
|
||||||
|
'--layout-header-zIndex': theme.zIndex.drawer + 2,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,35 @@ export function DashboardLayout({
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const inheritedHeaderSx = slotProps?.header?.sx;
|
||||||
|
|
||||||
|
const headerSx: HeaderSectionProps['sx'] = [
|
||||||
|
(t) => ({
|
||||||
|
bgcolor: '#a52431',
|
||||||
|
color: t.vars.palette.common.white,
|
||||||
|
zIndex: 'var(--layout-header-zIndex)',
|
||||||
|
'--color': t.vars.palette.common.white,
|
||||||
|
'& .MuiButtonBase-root, & .MuiIconButton-root, & .MuiTypography-root, & .MuiSvgIcon-root': {
|
||||||
|
color: t.vars.palette.common.white,
|
||||||
|
},
|
||||||
|
'& .MuiInputBase-root': {
|
||||||
|
color: t.vars.palette.common.white,
|
||||||
|
bgcolor: 'rgba(255, 255, 255, 0.12)',
|
||||||
|
'& .MuiInputBase-input::placeholder': {
|
||||||
|
color: 'rgba(255, 255, 255, 0.72)',
|
||||||
|
},
|
||||||
|
'& .MuiSvgIcon-root': {
|
||||||
|
color: t.vars.palette.common.white,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
...(Array.isArray(inheritedHeaderSx)
|
||||||
|
? inheritedHeaderSx
|
||||||
|
: inheritedHeaderSx
|
||||||
|
? [inheritedHeaderSx]
|
||||||
|
: []),
|
||||||
|
];
|
||||||
|
|
||||||
const headerSlots: HeaderSectionProps['slots'] = {
|
const headerSlots: HeaderSectionProps['slots'] = {
|
||||||
topArea: (
|
topArea: (
|
||||||
<Alert severity="info" sx={{ display: 'none', borderRadius: 0 }}>
|
<Alert severity="info" sx={{ display: 'none', borderRadius: 0 }}>
|
||||||
@@ -94,11 +123,12 @@ export function DashboardLayout({
|
|||||||
return (
|
return (
|
||||||
<HeaderSection
|
<HeaderSection
|
||||||
disableElevation
|
disableElevation
|
||||||
|
disableOffset
|
||||||
layoutQuery={layoutQuery}
|
layoutQuery={layoutQuery}
|
||||||
{...slotProps?.header}
|
{...slotProps?.header}
|
||||||
slots={{ ...headerSlots, ...slotProps?.header?.slots }}
|
slots={{ ...headerSlots, ...slotProps?.header?.slots }}
|
||||||
slotProps={merge(headerSlotProps, slotProps?.header?.slotProps ?? {})}
|
slotProps={merge(headerSlotProps, slotProps?.header?.slotProps ?? {})}
|
||||||
sx={slotProps?.header?.sx}
|
sx={headerSx}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -129,7 +159,7 @@ export function DashboardLayout({
|
|||||||
cssVars={{ ...dashboardLayoutVars(theme), ...cssVars }}
|
cssVars={{ ...dashboardLayoutVars(theme), ...cssVars }}
|
||||||
sx={[
|
sx={[
|
||||||
{
|
{
|
||||||
[`& .${layoutClasses.sidebarContainer}`]: {
|
[`& .${layoutClasses.main}`]: {
|
||||||
[theme.breakpoints.up(layoutQuery)]: {
|
[theme.breakpoints.up(layoutQuery)]: {
|
||||||
pl: 'var(--layout-nav-vertical-width)',
|
pl: 'var(--layout-nav-vertical-width)',
|
||||||
transition: theme.transitions.create(['padding-left'], {
|
transition: theme.transitions.create(['padding-left'], {
|
||||||
|
|||||||
@@ -47,15 +47,17 @@ export function NavDesktop({
|
|||||||
sx={{
|
sx={{
|
||||||
pt: 2.5,
|
pt: 2.5,
|
||||||
px: 2.5,
|
px: 2.5,
|
||||||
top: 0,
|
top: 'var(--layout-header-desktop-height)',
|
||||||
left: 0,
|
left: 0,
|
||||||
height: 1,
|
height: 'calc(100% - var(--layout-header-desktop-height))',
|
||||||
display: 'none',
|
display: 'none',
|
||||||
position: 'fixed',
|
position: 'fixed',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
zIndex: 'var(--layout-nav-zIndex)',
|
zIndex: 'var(--layout-nav-zIndex)',
|
||||||
width: 'var(--layout-nav-vertical-width)',
|
width: 'var(--layout-nav-vertical-width)',
|
||||||
borderRight: `1px solid ${varAlpha(theme.vars.palette.grey['500Channel'], 0.12)}`,
|
bgcolor: '#ffe8ed',
|
||||||
|
color: '#4a0f14',
|
||||||
|
borderRight: `1px solid ${varAlpha('74 15 20', 0.12)}`,
|
||||||
[theme.breakpoints.up(layoutQuery)]: {
|
[theme.breakpoints.up(layoutQuery)]: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
},
|
},
|
||||||
@@ -96,6 +98,8 @@ export function NavMobile({
|
|||||||
px: 2.5,
|
px: 2.5,
|
||||||
overflow: 'unset',
|
overflow: 'unset',
|
||||||
width: 'var(--layout-nav-mobile-width)',
|
width: 'var(--layout-nav-mobile-width)',
|
||||||
|
bgcolor: '#ffe8ed',
|
||||||
|
color: '#4a0f14',
|
||||||
...sx,
|
...sx,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
@@ -112,12 +116,8 @@ export function NavContent({ data, slots, workspaces, sx }: NavContentProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Logo />
|
|
||||||
|
|
||||||
{slots?.topArea}
|
{slots?.topArea}
|
||||||
|
|
||||||
<WorkspacesPopover data={workspaces} sx={{ my: 2 }} />
|
|
||||||
|
|
||||||
<Scrollbar fillContent>
|
<Scrollbar fillContent>
|
||||||
<Box
|
<Box
|
||||||
component="nav"
|
component="nav"
|
||||||
@@ -156,14 +156,14 @@ export function NavContent({ data, slots, workspaces, sx }: NavContentProps) {
|
|||||||
borderRadius: 0.75,
|
borderRadius: 0.75,
|
||||||
typography: 'body2',
|
typography: 'body2',
|
||||||
fontWeight: 'fontWeightMedium',
|
fontWeight: 'fontWeightMedium',
|
||||||
color: theme.vars.palette.text.secondary,
|
color: '#4a0f14',
|
||||||
minHeight: 44,
|
minHeight: 44,
|
||||||
...(isActived && {
|
...(isActived && {
|
||||||
fontWeight: 'fontWeightSemiBold',
|
fontWeight: 'fontWeightSemiBold',
|
||||||
color: theme.vars.palette.primary.main,
|
color: '#4a0f14',
|
||||||
bgcolor: varAlpha(theme.vars.palette.primary.mainChannel, 0.08),
|
bgcolor: 'rgba(74, 15, 20, 0.12)',
|
||||||
'&:hover': {
|
'&:hover': {
|
||||||
bgcolor: varAlpha(theme.vars.palette.primary.mainChannel, 0.16),
|
bgcolor: 'rgba(74, 15, 20, 0.18)',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user