import { useState } from 'react' import { Link, useLocation } from 'react-router-dom' import { appRoutes, getProfilePageRoute } from 'routes' import 'styles/socialNav.css' export const SocialNav = () => { const location = useLocation() const currentPath = location.pathname const [isCollapsed, setIsCollapsed] = useState(false) const toggleNav = () => { setIsCollapsed(!isCollapsed) } const isOnHomePage = currentPath === appRoutes.index || currentPath === appRoutes.home const isOnSearchPage = currentPath === appRoutes.search const isOnProfilePage = new RegExp( `^${appRoutes.profile.replace(':nprofile', '[^/]+')}$` ).test(currentPath) return (
{!isCollapsed && (
)}
) } interface NavButtonProps { to: string isActive: boolean svgPath: string } const NavButton = ({ to, isActive, svgPath }: NavButtonProps) => ( )