mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-31 04:04:27 +01:00
- 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
18 lines
445 B
TypeScript
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'
|
|
} |