Skip to content

Repo sync #33384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Private vulnerability reporting makes it easy for security researchers to report
For security researchers, the benefits of using private vulnerability reporting are:
- Less frustration, and less time spent trying to figure out how to contact the maintainer.
- A smoother process for disclosing and discussing vulnerability details.
- The opportunity to discuss vulnerability details privately with repository maintainer.
- The opportunity to discuss vulnerability details privately with the repository maintainer.

{% data reusables.security-advisory.private-vulnerability-reporting-disabled %}

Expand Down
9 changes: 3 additions & 6 deletions src/landings/components/SidebarProduct.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Link from 'next/link'
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import { NavList } from '@primer/react'
Expand Down Expand Up @@ -75,20 +76,16 @@ export const SidebarProduct = () => {
}

function NavListItem({ childPage }: { childPage: ProductTreeNode }) {
const { push, asPath, locale } = useRouter()
const { asPath, locale } = useRouter()
const routePath = `/${locale}${asPath.split('?')[0].split('#')[0]}`
const isActive = routePath === childPage.href

return (
<NavList.Item
defaultOpen={childPage.childPages.length > 0 && routePath.includes(childPage.href)}
href={childPage.href}
as={Link}
aria-current={isActive ? 'page' : false}
onClick={(event) => {
// XXX TODO: If the `childPage.href` is an external link, don't try to do anything fancy here.
event.preventDefault()
push(childPage.href)
}}
>
{childPage.title}
{childPage.childPages.length > 0 && (
Expand Down
Loading