Skip to content

Commit 29266a6

Browse files
authored
Merge branch 'main' into main
2 parents ba7bdb4 + 736eb56 commit 29266a6

File tree

47 files changed

+723
-87
lines changed

Some content is hidden

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

47 files changed

+723
-87
lines changed

.github/workflows/send-issues-to-how-how-we-work-boards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
github-token: ${{ secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES }}
5353
script: |
54-
var column_id = 13445932;
54+
var column_id = 12860544;
5555
try {
5656
github.projects.createCard({
5757
column_id: column_id,
139 KB
Loading
128 KB
Loading
246 KB
Loading
89.2 KB
Loading
83.9 KB
Loading

components/Breadcrumbs.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import cx from 'classnames'
2+
import Link from 'next/link'
3+
import { useRouter } from 'next/router'
4+
import { useMainContext } from './context/MainContext'
5+
6+
export type BreadcrumbT = {
7+
title: string
8+
documentType?: string
9+
href?: string
10+
}
11+
12+
type Props = {}
13+
export const Breadcrumbs = (props: Props) => {
14+
const router = useRouter()
15+
const pathWithLocale = `/${router.locale}${router.asPath}`
16+
const { breadcrumbs } = useMainContext()
17+
18+
return (
19+
<nav className="breadcrumbs f5" aria-label="Breadcrumb">
20+
{Object.values(breadcrumbs).map((breadcrumb) => {
21+
const title = `${breadcrumb.documentType}: ${breadcrumb.title}`
22+
return !breadcrumb.href ? (
23+
<span key={title} title={title}>
24+
{breadcrumb.title}
25+
</span>
26+
) : (
27+
<Link key={title} href={breadcrumb.href}>
28+
<a
29+
title={title}
30+
className={cx(
31+
'd-inline-block',
32+
pathWithLocale === breadcrumb.href && 'color-text-tertiary'
33+
)}
34+
>
35+
{breadcrumb.title}
36+
</a>
37+
</Link>
38+
)
39+
})}
40+
</nav>
41+
)
42+
}

components/Contribution.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { GitPullRequestIcon } from '@primer/octicons-react'
2+
import { useMainContext } from 'components/context/MainContext'
3+
import { useTranslation } from 'components/hooks/useTranslation'
4+
5+
export const Contribution = () => {
6+
const { relativePath } = useMainContext()
7+
const { t } = useTranslation('contribution_cta')
8+
9+
const contribution_href = relativePath
10+
? `https://github.com/github/docs/edit/main/content/${relativePath}`
11+
: 'https://github.com/github/docs'
12+
13+
return (
14+
<div className="f5 contribution">
15+
<h2 className="f4">{t`title`}</h2>
16+
<p className="color-text-secondary f6">{t`body`}</p>
17+
<a className="btn btn-outline" href={contribution_href}>
18+
<GitPullRequestIcon size="small" className="octicon mr-1" />
19+
{t`button`}
20+
</a>
21+
<p className="color-text-secondary f6 mt-2">
22+
{t`or`}{' '}
23+
<a href="https://github.com/github/docs/blob/main/CONTRIBUTING.md" target="_blank">
24+
{t`to_guidelines`}
25+
</a>
26+
</p>
27+
</div>
28+
)
29+
}

components/DefaultLayout.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import Head from 'next/head'
2+
3+
// import { Sidebar } from 'components/Sidebar'
4+
// import { Header } from 'components/Header'
5+
import { SmallFooter } from 'components/SmallFooter'
6+
import { ScrollButton } from 'components/ScrollButton'
7+
import { SupportSection } from 'components/SupportSection'
8+
import { DeprecationBanner } from 'components/DeprecationBanner'
9+
import { useMainContext } from 'components/context/MainContext'
10+
11+
type Props = { children?: React.ReactNode }
12+
export const DefaultLayout = (props: Props) => {
13+
const { builtAssets, expose } = useMainContext()
14+
return (
15+
<div className="d-lg-flex">
16+
<Head>
17+
<link rel="stylesheet" href={builtAssets.main.css} />
18+
<script id="expose" type="application/json" dangerouslySetInnerHTML={{ __html: expose }} />
19+
<script src={builtAssets.main.js} />
20+
</Head>
21+
{/* <Sidebar /> */}
22+
23+
<main className="width-full">
24+
{/* <Header /> */}
25+
<DeprecationBanner />
26+
27+
{props.children}
28+
29+
<SupportSection />
30+
<SmallFooter />
31+
<ScrollButton />
32+
</main>
33+
</div>
34+
)
35+
}

components/DeprecationBanner.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { useMainContext } from 'components/context/MainContext'
2+
import { useVersion } from 'components/hooks/useVersion'
3+
4+
export const DeprecationBanner = () => {
5+
const { data, enterpriseServerReleases } = useMainContext()
6+
const { currentVersion } = useVersion()
7+
8+
if (!currentVersion.includes(enterpriseServerReleases.oldestSupported)) {
9+
return null
10+
}
11+
12+
const message = enterpriseServerReleases.isOldestReleaseDeprecated
13+
? data.reusables.enterprise_deprecation.version_was_deprecated
14+
: data.reusables.enterprise_deprecation.version_will_be_deprecated
15+
16+
return (
17+
<div className="deprecation-banner border rounded-1 mb-2 color-bg-warning p-3 color-border-warning f5">
18+
<p>
19+
<b>
20+
<span dangerouslySetInnerHTML={{ __html: message }} />{' '}
21+
<span
22+
data-date={enterpriseServerReleases.nextDeprecationDate}
23+
data-format="%B %d, %Y"
24+
title={enterpriseServerReleases.nextDeprecationDate}
25+
>
26+
{enterpriseServerReleases.nextDeprecationDate}
27+
</span>
28+
.
29+
</b>{' '}
30+
<span
31+
dangerouslySetInnerHTML={{
32+
__html: data.reusables.enterprise_deprecation.deprecation_details,
33+
}}
34+
/>
35+
</p>
36+
</div>
37+
)
38+
}

0 commit comments

Comments
 (0)