add available positions to mobile nav (#613)

This commit is contained in:
nikec 2023-03-16 14:20:38 +01:00 committed by GitHub
parent e874aed431
commit 1694b09057
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,9 +22,12 @@ function NavLink(props: PropsWithChildren<{ link?: string }>) {
}
function link(path: string) {
const selected = getWindow()?.location.href.includes(path);
return {
selected: getWindow()?.location.href.includes(path),
onClick: () => router.navigate(path)
selected,
onClick: () => router.navigate(path),
className: clsx(selected && 'bg-accent/20')
};
}
@ -114,6 +117,11 @@ export default function NavBar() {
</Dropdown.Item>
<Dropdown.Item icon={Academia} {...link('/careers')}>
Careers
{positions.length > 0 ? (
<span className="bg-primary ml-2 rounded-md px-[5px] py-px text-xs">
{positions.length}
</span>
) : null}
</Dropdown.Item>
</Dropdown.Section>
</Dropdown.Root>