Skip to content

Commit

Permalink
Last fix for navbar and I am going to cry and eat my lunch
Browse files Browse the repository at this point in the history
  • Loading branch information
fwedwicc committed Aug 5, 2024
1 parent ac3b01e commit 5ff7c50
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,34 @@ const Navbar = () => {

// To get the current path/loc
const getPageName = () => {
const basePath = '/fmUI'; // Your base path
const path = location.pathname;
const fullPath = `/fmUI/${path}`;
const fullPath = path.startsWith(basePath) ? path : `${basePath}${path}`;

switch (fullPath) {
// Components
case '/fmUI/components/alert':
case `${basePath}/components/alert`:
return 'Alerts';
case '/fmUI/components/avatar':
case `${basePath}/components/avatar`:
return 'Avatars';
case '/fmUI/components/badge':
case `${basePath}/components/badge`:
return 'Badges';
case '/fmUI/components/breadcrumbs':
case `${basePath}/components/breadcrumbs`:
return 'Breadcrumbs';
case '/fmUI/components/button':
case `${basePath}/components/button`:
return 'Buttons';
case '/fmUI/components/checkbox':
case `${basePath}/components/checkbox`:
return 'Checkboxes';
case '/fmUI/components/inputField':
case `${basePath}/components/inputField`:
return 'Input Fields';
case '/fmUI/components/radio':
case `${basePath}/components/radio`:
return 'Radio';
case '/fmUI/components/tab':
case `${basePath}/components/tab`:
return 'Tab';
case '/fmUI/components/toggle':
case `${basePath}/components/toggle`:
return 'Toggles';
// Templates
case '/fmUI/components/authPage':
case `${basePath}/components/authPage`:
return 'Auth Pages';
default:
return <HiHeart />;
Expand Down

0 comments on commit 5ff7c50

Please sign in to comment.