1
0
mirror of synced 2026-01-08 03:01:54 -05:00

Merge pull request #15098 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2022-02-04 16:28:55 -06:00
committed by GitHub
3 changed files with 6 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
import Cookies from 'js-cookie'
import { SubNav, TabNav, UnderlineNav } from '@primer/components'
import { sendEvent, EventType } from 'components/lib/events'
import { useRouter } from 'next/router'
import { useArticleContext } from 'components/context/ArticleContext'
import parseUserAgent from 'components/lib/user-agent'
@@ -50,6 +51,7 @@ type Props = {
export const PlatformPicker = ({ variant = 'subnav' }: Props) => {
const { defaultPlatform, detectedPlatforms } = useArticleContext()
const [currentPlatform, setCurrentPlatform] = useState(defaultPlatform || '')
const { asPath } = useRouter()
// Run on mount for client-side only features
useEffect(() => {
@@ -63,7 +65,7 @@ export const PlatformPicker = ({ variant = 'subnav' }: Props) => {
// always trigger this on initial render. if the default doesn't change the other useEffect won't fire
showPlatformSpecificContent(platform)
}, [])
}, [asPath])
// Make sure we've always selected a platform that exists in the article
useEffect(() => {

View File

@@ -26,8 +26,8 @@ export const VersionPicker = ({ variant }: Props) => {
selected: allVersions[currentVersion].versionTitle === permalink.pageVersionTitle,
item: <Link href={permalink.href}>{permalink.pageVersionTitle}</Link>,
}))
const hasEnterpriseVersions = (page.permalinks || []).find((permalink) =>
permalink.pageVersion.startsWith('enterprise-version')
const hasEnterpriseVersions = (page.permalinks || []).some((permalink) =>
permalink.pageVersion.startsWith('enterprise-server')
)
if (hasEnterpriseVersions) {

View File

@@ -53,7 +53,7 @@ pages:
article_version: 'Article version'
miniToc: In this article
contributor_callout: This article is contributed and maintained by
all_enterprise_releases: All Enterprise releases
all_enterprise_releases: All Enterprise Server releases
errors:
oops: Ooops!
something_went_wrong: It looks like something went wrong.