adhusted the breadcrumb to have the last one highlighted again

This commit is contained in:
csawatzky 2025-03-03 11:28:37 -06:00
parent cf559d48a2
commit 9b274b9e16
3 changed files with 7 additions and 13 deletions

9
package-lock.json generated
View file

@ -39,7 +39,6 @@
"react-router-dom": "^6.28.0", "react-router-dom": "^6.28.0",
"react-virtualized-auto-sizer": "^1.0.25", "react-virtualized-auto-sizer": "^1.0.25",
"recharts": "^2.15.1", "recharts": "^2.15.1",
"save-svg-as-png": "^1.4.17",
"victory": "^37.3.6" "victory": "^37.3.6"
}, },
"devDependencies": { "devDependencies": {
@ -56,7 +55,6 @@
"eslint-plugin-react-hooks": "^5.1.0-rc.0", "eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12", "eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0", "globals": "^15.9.0",
"save-svg-as-png": "^1.4.17",
"typescript": "^5.5.3", "typescript": "^5.5.3",
"typescript-eslint": "^8.7.0", "typescript-eslint": "^8.7.0",
"vite": "^6.2.0", "vite": "^6.2.0",
@ -7910,13 +7908,6 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/save-svg-as-png": {
"version": "1.4.17",
"resolved": "https://registry.npmjs.org/save-svg-as-png/-/save-svg-as-png-1.4.17.tgz",
"integrity": "sha512-7QDaqJsVhdFPwviCxkgHiGm9omeaMBe1VKbHySWU6oFB2LtnGCcYS13eVoslUgq6VZC6Tjq/HddBd1K6p2PGpA==",
"dev": true,
"license": "MIT"
},
"node_modules/scheduler": { "node_modules/scheduler": {
"version": "0.23.2", "version": "0.23.2",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",

View file

@ -49,7 +49,6 @@
"react-router-dom": "^6.28.0", "react-router-dom": "^6.28.0",
"react-virtualized-auto-sizer": "^1.0.25", "react-virtualized-auto-sizer": "^1.0.25",
"recharts": "^2.15.1", "recharts": "^2.15.1",
"save-svg-as-png": "^1.4.17",
"victory": "^37.3.6" "victory": "^37.3.6"
}, },
"devDependencies": { "devDependencies": {
@ -66,7 +65,6 @@
"eslint-plugin-react-hooks": "^5.1.0-rc.0", "eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12", "eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0", "globals": "^15.9.0",
"save-svg-as-png": "^1.4.17",
"typescript": "^5.5.3", "typescript": "^5.5.3",
"typescript-eslint": "^8.7.0", "typescript-eslint": "^8.7.0",
"vite": "^6.2.0", "vite": "^6.2.0",

View file

@ -270,9 +270,12 @@ export default function SmartBreadcrumb(props: Props) {
if (prependPaths) pathnames.unshift(...prependPaths) if (prependPaths) pathnames.unshift(...prependPaths)
console.log(pathnames)
pathnames.forEach((_value: any, index: any) => { pathnames.forEach((_value: any, index: any) => {
const lastPath = index === pathnames.length - 1; const lastPath = index === pathnames.length - 1;
console.log(lastPath)
const to = `/${pathnames.slice(0, index + 1).join("/")}`; const to = `/${pathnames.slice(0, index + 1).join("/")}`;
let label = breadcrumbMap[to]; let label = breadcrumbMap[to];
@ -304,10 +307,12 @@ export default function SmartBreadcrumb(props: Props) {
variant={lastPath ? "filled" : "outlined"} variant={lastPath ? "filled" : "outlined"}
label={ label={
<LinkRouter <LinkRouter
color={lastPath ? "textPrimary" : "textSecondary"} //color={lastPath ? "textPrimary" : "textSecondary"}
variant="subtitle1" variant="subtitle1"
to={to} to={to}
sx={{ '&:hover': { color: getThemeType() === "dark" ? 'white' : "black" } }} sx={{ '&:hover': { color: getThemeType() === "dark" ? 'white' : "black" },
color: lastPath ? "HighlightText" : "GrayText"
}}
className={classes.textOverflow}> className={classes.textOverflow}>
{label} {label}
</LinkRouter> </LinkRouter>