mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-17 21:00:45 +00:00
CE-798 turn off fixed navbar; move pageHeader from Breadcrumbs to NavBar
CE-798 turn off fixed navbar; move pageHeader from Breadcrumbs to NavBar
This commit is contained in:
@ -70,7 +70,7 @@ function QBreadcrumbs({icon, title, route, light}: Props): JSX.Element
|
|||||||
}
|
}
|
||||||
|
|
||||||
const routes: string[] | any = route.slice(0, -1);
|
const routes: string[] | any = route.slice(0, -1);
|
||||||
const {pageHeader, pathToLabelMap, branding} = useContext(QContext);
|
const {pathToLabelMap, branding} = useContext(QContext);
|
||||||
|
|
||||||
const fullPathToLabel = (fullPath: string, route: string): string =>
|
const fullPathToLabel = (fullPath: string, route: string): string =>
|
||||||
{
|
{
|
||||||
@ -149,15 +149,6 @@ function QBreadcrumbs({icon, title, route, light}: Props): JSX.Element
|
|||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
</MuiBreadcrumbs>
|
</MuiBreadcrumbs>
|
||||||
<MDTypography
|
|
||||||
pt={1}
|
|
||||||
textTransform="capitalize"
|
|
||||||
variant="h3"
|
|
||||||
color={light ? "white" : "dark"}
|
|
||||||
noWrap
|
|
||||||
>
|
|
||||||
{pageHeader}
|
|
||||||
</MDTypography>
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -22,12 +22,10 @@
|
|||||||
import {Popper, InputAdornment} from "@mui/material";
|
import {Popper, InputAdornment} from "@mui/material";
|
||||||
import AppBar from "@mui/material/AppBar";
|
import AppBar from "@mui/material/AppBar";
|
||||||
import Autocomplete from "@mui/material/Autocomplete";
|
import Autocomplete from "@mui/material/Autocomplete";
|
||||||
import Badge from "@mui/material/Badge";
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
import Icon from "@mui/material/Icon";
|
import Icon from "@mui/material/Icon";
|
||||||
import IconButton from "@mui/material/IconButton";
|
import IconButton from "@mui/material/IconButton";
|
||||||
import ListItemIcon from "@mui/material/ListItemIcon";
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
||||||
import Menu from "@mui/material/Menu";
|
|
||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import Toolbar from "@mui/material/Toolbar";
|
import Toolbar from "@mui/material/Toolbar";
|
||||||
import React, {useContext, useEffect, useState} from "react";
|
import React, {useContext, useEffect, useState} from "react";
|
||||||
@ -35,6 +33,7 @@ import {useLocation, useNavigate} from "react-router-dom";
|
|||||||
import QContext from "QContext";
|
import QContext from "QContext";
|
||||||
import QBreadcrumbs, {routeToLabel} from "qqq/components/horseshoe/Breadcrumbs";
|
import QBreadcrumbs, {routeToLabel} from "qqq/components/horseshoe/Breadcrumbs";
|
||||||
import {navbar, navbarContainer, navbarRow, navbarMobileMenu, recentlyViewedMenu,} from "qqq/components/horseshoe/Styles";
|
import {navbar, navbarContainer, navbarRow, navbarMobileMenu, recentlyViewedMenu,} from "qqq/components/horseshoe/Styles";
|
||||||
|
import MDTypography from "qqq/components/legacy/MDTypography";
|
||||||
import {setTransparentNavbar, useMaterialUIController, setMiniSidenav} from "qqq/context";
|
import {setTransparentNavbar, useMaterialUIController, setMiniSidenav} from "qqq/context";
|
||||||
import HistoryUtils from "qqq/utils/HistoryUtils";
|
import HistoryUtils from "qqq/utils/HistoryUtils";
|
||||||
|
|
||||||
@ -65,6 +64,8 @@ function NavBar({absolute, light, isMini}: Props): JSX.Element
|
|||||||
const route = useLocation().pathname.split("/").slice(1);
|
const route = useLocation().pathname.split("/").slice(1);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const {pageHeader} = useContext(QContext);
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
// Setting the navbar type
|
// Setting the navbar type
|
||||||
@ -234,25 +235,27 @@ function NavBar({absolute, light, isMini}: Props): JSX.Element
|
|||||||
>
|
>
|
||||||
<Toolbar sx={navbarContainer}>
|
<Toolbar sx={navbarContainer}>
|
||||||
<Box color="inherit" mb={{xs: 1, md: 0}} sx={(theme) => navbarRow(theme, {isMini})}>
|
<Box color="inherit" mb={{xs: 1, md: 0}} sx={(theme) => navbarRow(theme, {isMini})}>
|
||||||
<IconButton
|
<IconButton size="small" disableRipple color="inherit" sx={navbarMobileMenu} onClick={handleMiniSidenav}>
|
||||||
size="small"
|
|
||||||
disableRipple
|
|
||||||
color="inherit"
|
|
||||||
sx={navbarMobileMenu}
|
|
||||||
onClick={handleMiniSidenav}
|
|
||||||
>
|
|
||||||
<Icon sx={iconsStyle} fontSize="large">menu</Icon>
|
<Icon sx={iconsStyle} fontSize="large">menu</Icon>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<QBreadcrumbs icon="home" title={breadcrumbTitle} route={route} light={light} />
|
<QBreadcrumbs icon="home" title={breadcrumbTitle} route={route} light={light} />
|
||||||
</Box>
|
</Box>
|
||||||
{isMini ? null : (
|
{isMini ? null : (
|
||||||
<Box sx={(theme) => navbarRow(theme, {isMini})}>
|
<Box sx={(theme) => navbarRow(theme, {isMini})}>
|
||||||
<Box pr={0} mr={-2} mt={-4}>
|
<Box pr={0} mr={-2}>
|
||||||
{renderHistory()}
|
{renderHistory()}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
|
{
|
||||||
|
pageHeader &&
|
||||||
|
<Box display="flex" justifyContent="space-between">
|
||||||
|
<MDTypography pt={1} textTransform="capitalize" variant="h3" color={light ? "white" : "dark"} noWrap>
|
||||||
|
{pageHeader}
|
||||||
|
</MDTypography>
|
||||||
|
</Box>
|
||||||
|
}
|
||||||
</AppBar>
|
</AppBar>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -66,12 +66,12 @@ function navbar(theme: Theme | any, ownerState: any)
|
|||||||
return color;
|
return color;
|
||||||
},
|
},
|
||||||
top: absolute ? 0 : pxToRem(12),
|
top: absolute ? 0 : pxToRem(12),
|
||||||
minHeight: pxToRem(75),
|
minHeight: "auto",
|
||||||
display: "grid",
|
display: "grid",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
borderRadius: borderRadius.xl,
|
borderRadius: borderRadius.xl,
|
||||||
paddingTop: pxToRem(8),
|
paddingTop: pxToRem(0),
|
||||||
paddingBottom: pxToRem(8),
|
paddingBottom: pxToRem(0),
|
||||||
paddingRight: absolute ? pxToRem(8) : 0,
|
paddingRight: absolute ? pxToRem(8) : 0,
|
||||||
paddingLeft: absolute ? pxToRem(16) : 0,
|
paddingLeft: absolute ? pxToRem(16) : 0,
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ function navbar(theme: Theme | any, ownerState: any)
|
|||||||
"& .MuiToolbar-root": {
|
"& .MuiToolbar-root": {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
alignItems: "center",
|
alignItems: "flex-start",
|
||||||
|
|
||||||
[breakpoints.up("sm")]: {
|
[breakpoints.up("sm")]: {
|
||||||
minHeight: "auto",
|
minHeight: "auto",
|
||||||
@ -99,10 +99,10 @@ const navbarContainer = ({breakpoints}: Theme): any => ({
|
|||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
alignItems: "flex-start",
|
alignItems: "flex-start",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
|
padding: "0 !important",
|
||||||
|
|
||||||
[breakpoints.up("md")]: {
|
[breakpoints.up("md")]: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "center",
|
|
||||||
paddingTop: "0",
|
paddingTop: "0",
|
||||||
paddingBottom: "0",
|
paddingBottom: "0",
|
||||||
},
|
},
|
||||||
@ -152,6 +152,7 @@ const navbarDesktopMenu = ({breakpoints}: Theme) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const recentlyViewedMenu = ({breakpoints}: Theme) => ({
|
const recentlyViewedMenu = ({breakpoints}: Theme) => ({
|
||||||
|
marginTop: "-0.5rem",
|
||||||
"& .MuiInputLabel-root": {
|
"& .MuiInputLabel-root": {
|
||||||
color: colors.gray.main,
|
color: colors.gray.main,
|
||||||
fontWeight: "500",
|
fontWeight: "500",
|
||||||
|
@ -41,7 +41,7 @@ interface Props
|
|||||||
|
|
||||||
QRecordSidebar.defaultProps = {
|
QRecordSidebar.defaultProps = {
|
||||||
light: false,
|
light: false,
|
||||||
stickyTop: "110px",
|
stickyTop: "1rem",
|
||||||
};
|
};
|
||||||
|
|
||||||
interface SidebarEntry
|
interface SidebarEntry
|
||||||
@ -76,7 +76,7 @@ function QRecordSidebar({tableSections, widgetMetaDataList, light, stickyTop}: P
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card sx={{borderRadius: "0.75rem", position: "sticky", top: stickyTop, overflow: "auto", maxHeight: "calc(100vh - 200px)"}}>
|
<Card sx={{borderRadius: "0.75rem", position: "sticky", top: stickyTop, overflow: "auto", maxHeight: "calc(100vh - 2rem)"}}>
|
||||||
<Box component="ul" display="flex" flexDirection="column" p={2} m={0} sx={{listStyle: "none"}}>
|
<Box component="ul" display="flex" flexDirection="column" p={2} m={0} sx={{listStyle: "none"}}>
|
||||||
{
|
{
|
||||||
sidebarEntries ? sidebarEntries.map((entry: SidebarEntry, key: number) => (
|
sidebarEntries ? sidebarEntries.map((entry: SidebarEntry, key: number) => (
|
||||||
|
@ -116,7 +116,7 @@ function MaterialUIControllerProvider({children}: { children: ReactNode }): JSX.
|
|||||||
whiteSidenav: false,
|
whiteSidenav: false,
|
||||||
sidenavColor: "info",
|
sidenavColor: "info",
|
||||||
transparentNavbar: true,
|
transparentNavbar: true,
|
||||||
fixedNavbar: true,
|
fixedNavbar: false,
|
||||||
openConfigurator: false,
|
openConfigurator: false,
|
||||||
direction: "ltr",
|
direction: "ltr",
|
||||||
layout: "dashboard",
|
layout: "dashboard",
|
||||||
|
Reference in New Issue
Block a user