Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: underline active page
  • Loading branch information
defispartan committed Apr 12, 2022
commit d68ed1e9232071d6f4f55b3b422830f680e87376
10 changes: 7 additions & 3 deletions src/layouts/components/NavItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Link } from '../../components/primitives/Link';
import { useProtocolDataContext } from '../../hooks/useProtocolDataContext';
import { navigation } from '../../ui-config/menu-items';
import { MoreMenu } from '../MoreMenu';
import { useRouter } from 'next/router';

interface NavItemsProps {
setOpen?: (value: boolean) => void;
Expand All @@ -17,6 +18,7 @@ export const NavItems = ({ setOpen }: NavItemsProps) => {

const { breakpoints } = useTheme();
const md = useMediaQuery(breakpoints.down('md'));
const router = useRouter();

return (
<List
Expand Down Expand Up @@ -66,13 +68,15 @@ export const NavItems = ({ setOpen }: NavItemsProps) => {
content: "''",
position: 'absolute',
width: '100%',
transform: 'scaleX(0)',
height: '2px',
bottom: '-6px',
left: '0',
background: theme.palette.gradients.aaveGradient,
transformOrigin: 'bottom right',
transition: 'transform 0.25s ease-out',
...(router.pathname !== item.link && {
transform: 'scaleX(0)',
transformOrigin: 'bottom right',
transition: 'transform 0.25s ease-out',
}),
},
})}
>
Expand Down