mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 13:20:43 +00:00
Strip trailing slashes from routes / breadcrumbs / titles
This commit is contained in:
@ -215,6 +215,11 @@ function NavBar({absolute, light, isMini}: Props): JSX.Element
|
||||
const {pathToLabelMap} = useContext(QContext);
|
||||
const fullPathToLabel = (fullPath: string, route: string): string =>
|
||||
{
|
||||
if(fullPath.endsWith("/"))
|
||||
{
|
||||
fullPath = fullPath.replace(/\/+$/, "");
|
||||
}
|
||||
|
||||
if(pathToLabelMap && pathToLabelMap[fullPath])
|
||||
{
|
||||
return pathToLabelMap[fullPath];
|
||||
|
Reference in New Issue
Block a user