Files
landscape-template/src/utils/hooks/useCurrentSection.ts
MTG2000 6858639161 update: update navigation components
- Update 'products' to 'apps'
- Make nav content stay withing the same contains as the page body on large screen.
- Change nav items order on mobile
- Add emojis to profile menu items

#107
2022-08-03 10:55:30 +03:00

18 lines
445 B
TypeScript

import { useLocation } from "react-router-dom"
export const useCurrentSection = () => {
const location = useLocation();
if (location.pathname.startsWith('/blog'))
return 'blog';
if (location.pathname.startsWith('/hackathons'))
return 'hackathons';
if (location.pathname.startsWith('/apps'))
return 'apps';
if (location.pathname.startsWith('/donate'))
return 'donate';
return 'other'
}