Spaces:
Sleeping
Sleeping
Update frontend/src/utils.js
Browse files- frontend/src/utils.js +6 -3
frontend/src/utils.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
|
|
|
|
|
| 1 |
export function createPageUrl(pageName) {
|
| 2 |
-
if (pageName
|
| 3 |
-
|
| 4 |
-
return "/
|
|
|
|
| 5 |
}
|
|
|
|
| 1 |
+
// frontend/src/utils.jsx
|
| 2 |
+
|
| 3 |
export function createPageUrl(pageName) {
|
| 4 |
+
if (!pageName) return "/";
|
| 5 |
+
const lower = pageName.toLowerCase();
|
| 6 |
+
if (lower === "dashboard") return "/";
|
| 7 |
+
return `/${lower}`;
|
| 8 |
}
|