Skip to content

Commit 22fcd56

Browse files
authored
Merge branch 'main' into grace-change-headers
2 parents 3d302ab + 340f663 commit 22fcd56

File tree

149 files changed

+1525
-976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1525
-976
lines changed

.github/workflows/update-status-labels-on-tracking-issues.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
const repo = context.payload.repository.name
1818
1919
const allStatusLabels = [
20-
'Status: GREEN',
21-
'Status: GREY',
22-
'Status: YELLOW',
23-
'Status: BLACK',
24-
'Status: RED'
20+
'green',
21+
'grey',
22+
'yellow',
23+
'black',
24+
'red'
2525
];
2626
2727
const currentLabels = await github.issues.listLabelsOnIssue({
@@ -33,7 +33,7 @@ jobs:
3333
const newLabels = currentLabels.data.filter( label => allStatusLabels.includes(label.name) === false)
3434
3535
allStatusLabels.forEach( label => {
36-
if(context.payload.comment.body.includes(label)) {
36+
if(context.payload.comment.body.toLowerCase().includes(`status: ${label}`)) {
3737
newLabels.push(label)
3838
}
3939
});
73.7 KB
Loading

components/Breadcrumbs.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import cx from 'classnames'
2-
import Link from 'next/link'
32
import { useRouter } from 'next/router'
43
import { useMainContext } from './context/MainContext'
4+
import { Link } from 'components/Link'
55

66
export type BreadcrumbT = {
77
title: string
@@ -12,7 +12,7 @@ export type BreadcrumbT = {
1212
type Props = {}
1313
export const Breadcrumbs = (props: Props) => {
1414
const router = useRouter()
15-
const pathWithLocale = `/${router.locale}${router.asPath}`
15+
const pathWithLocale = `/${router.locale}${router.asPath.split('?')[0]}` // remove query string
1616
const { breadcrumbs } = useMainContext()
1717

1818
return (
@@ -28,16 +28,16 @@ export const Breadcrumbs = (props: Props) => {
2828
{breadcrumb.title}
2929
</span>
3030
) : (
31-
<Link key={title} href={breadcrumb.href}>
32-
<a
33-
title={title}
34-
className={cx(
35-
'd-inline-block',
36-
pathWithLocale === breadcrumb.href && 'color-text-tertiary'
37-
)}
38-
>
39-
{breadcrumb.title}
40-
</a>
31+
<Link
32+
key={title}
33+
href={breadcrumb.href}
34+
title={title}
35+
className={cx(
36+
'd-inline-block',
37+
pathWithLocale === breadcrumb.href && 'color-text-tertiary'
38+
)}
39+
>
40+
{breadcrumb.title}
4141
</Link>
4242
)
4343
})}

components/DefaultLayout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const DefaultLayout = (props: Props) => {
2424
<title>{page.fullTitle}</title>
2525
) : null}
2626

27-
<link rel="stylesheet" href={builtAssets.main.css} />
2827
<script id="expose" type="application/json" dangerouslySetInnerHTML={{ __html: expose }} />
2928
<script src={builtAssets.main.js} />
3029

components/Header.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useState } from 'react'
2-
import Link from 'next/link'
32
import cx from 'classnames'
43
import { useRouter } from 'next/router'
54
import { ChevronDownIcon, MarkGithubIcon, ThreeBarsIcon, XIcon } from '@primer/octicons-react'
65
import { ButtonOutline } from '@primer/components'
76

7+
import { Link } from 'components/Link'
88
import { useMainContext } from './context/MainContext'
99
import { LanguagePicker } from './LanguagePicker'
1010
import { HeaderNotifications } from 'components/HeaderNotifications'
@@ -34,16 +34,15 @@ export const Header = () => {
3434
id="github-logo-mobile"
3535
role="banner"
3636
>
37-
<Link href={`/${router.locale}`}>
38-
<a aria-hidden="true" tabIndex={-1}>
39-
<MarkGithubIcon size={32} className="color-icon-primary" />
40-
</a>
37+
<Link aria-hidden="true" tabIndex={-1} href={`/${router.locale}`}>
38+
<MarkGithubIcon size={32} className="color-icon-primary" />
4139
</Link>
4240

43-
<Link href={`/${router.locale}`}>
44-
<a className="h4-mktg color-text-primary no-underline no-wrap pl-2">
45-
{t('github_docs')}
46-
</a>
41+
<Link
42+
href={`/${router.locale}`}
43+
className="h4-mktg color-text-primary no-underline no-wrap pl-2"
44+
>
45+
{t('github_docs')}
4746
</Link>
4847
</div>
4948

components/HeaderNotifications.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const HeaderNotifications = () => {
7070
return (
7171
<>
7272
{allNotifications.map(({ type, content }, i) => {
73-
const isLast = i !== allNotifications.length - 1
73+
const isLast = i === allNotifications.length - 1
7474
return (
7575
<div
7676
className={cx(

components/LanguagePicker.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import Link from 'next/link'
21
import { useRouter } from 'next/router'
32
import { Dropdown } from '@primer/components'
3+
4+
import { Link } from 'components/Link'
45
import { useMainContext } from './context/MainContext'
56

67
export const LanguagePicker = () => {
@@ -12,7 +13,13 @@ export const LanguagePicker = () => {
1213

1314
return (
1415
<div className="ml-4 d-flex flex-justify-center flex-items-center">
15-
<Dropdown css>
16+
<Dropdown
17+
css={`
18+
ul {
19+
width: unset;
20+
}
21+
`}
22+
>
1623
<summary>
1724
{selectedLang.nativeName || selectedLang.name}
1825
<Dropdown.Caret />
@@ -22,15 +29,13 @@ export const LanguagePicker = () => {
2229
return (
2330
<Dropdown.Item key={lang.code}>
2431
<Link href={router.asPath} locale={lang.hreflang}>
25-
<a>
26-
{lang.nativeName ? (
27-
<>
28-
{lang.nativeName} ({lang.name})
29-
</>
30-
) : (
31-
lang.name
32-
)}
33-
</a>
32+
{lang.nativeName ? (
33+
<>
34+
{lang.nativeName} ({lang.name})
35+
</>
36+
) : (
37+
lang.name
38+
)}
3439
</Link>
3540
</Dropdown.Item>
3641
)

components/Link.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import NextLink from 'next/link'
2+
import { ComponentProps } from 'react'
3+
4+
const { NODE_ENV } = process.env
5+
6+
const enableNextLinks = false
7+
8+
type Props = { locale?: string } & ComponentProps<'a'>
9+
export function Link(props: Props) {
10+
const { href, locale, ...restProps } = props
11+
12+
if (!href && NODE_ENV !== 'production') {
13+
console.warn('Missing href on Link')
14+
}
15+
16+
if (enableNextLinks) {
17+
return (
18+
<NextLink href={href || ''} locale={locale}>
19+
<a {...restProps} />
20+
</NextLink>
21+
)
22+
}
23+
24+
return <a href={locale ? `/${locale}${href}` : href} {...restProps} />
25+
}

components/MobileProductDropdown.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import Link from 'next/link'
21
import { useRouter } from 'next/router'
32
import { LinkExternalIcon } from '@primer/octicons-react'
43
import cx from 'classnames'
54

5+
import { Link } from 'components/Link'
66
import { useMainContext } from 'components/context/MainContext'
77

88
export const MobileProductDropdown = () => {
@@ -20,22 +20,19 @@ export const MobileProductDropdown = () => {
2020
<Link
2121
key={product.id}
2222
href={`${product.external ? '' : `/${router.locale}`}${product.href}`}
23+
className={cx(
24+
'd-block py-2',
25+
product.id === currentProduct.id
26+
? 'color-text-link text-underline active'
27+
: 'Link--primary no-underline'
28+
)}
2329
>
24-
<a
25-
className={cx(
26-
'd-block py-2',
27-
product.id === currentProduct.id
28-
? 'color-text-link text-underline active'
29-
: 'Link--primary no-underline'
30-
)}
31-
>
32-
{product.name}
33-
{product.external && (
34-
<span className="ml-1">
35-
<LinkExternalIcon size="small" />
36-
</span>
37-
)}
38-
</a>
30+
{product.name}
31+
{product.external && (
32+
<span className="ml-1">
33+
<LinkExternalIcon size="small" />
34+
</span>
35+
)}
3936
</Link>
4037
)
4138
})}

components/ScrollButton.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ export const ScrollButton = () => {
4545
>
4646
<ChevronUpIcon />
4747
</button>
48-
<style jsx>{`
49-
.opacity-0 {
50-
opacity: 0;
51-
}
52-
.opacity-100 {
53-
opacity: 1;
54-
}
55-
.transition-200 {
56-
transition: 200ms;
57-
}
58-
`}</style>
5948
</div>
6049
)
6150
}

0 commit comments

Comments
 (0)