fix breadcrumb
This commit is contained in:
1 parent
a2db7b46d6
commit
93dd49c875
1 file changed
+5
-3
@@ -65,13 +65,15 @@ export const Breadcrumb = ({
|
|||||||
const last = index === pathnames.length - 1;
|
const last = index === pathnames.length - 1;
|
||||||
const to = `/${pathnames.slice(0, index + 1).join("/")}`;
|
const to = `/${pathnames.slice(0, index + 1).join("/")}`;
|
||||||
|
|
||||||
let displayName =
|
let displayName = "";
|
||||||
t(`common.breadcrumbs.${value}`) ||
|
|
||||||
value.charAt(0).toUpperCase() + value.slice(1);
|
|
||||||
|
|
||||||
// Paths that are IDs should be detail pages
|
// Paths that are IDs should be detail pages
|
||||||
if (value.length === 24 || value.match(/^[a-f0-9-]{36}$/)) {
|
if (value.length === 24 || value.match(/^[a-f0-9-]{36}$/)) {
|
||||||
displayName = "Details";
|
displayName = "Details";
|
||||||
|
} else {
|
||||||
|
displayName =
|
||||||
|
t(`common.breadcrumbs.${value}`) ||
|
||||||
|
value.charAt(0).toUpperCase() + value.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return last ? (
|
return last ? (
|
||||||
|
|||||||
Reference in new issue
Block a user