Skip to content

Commit bd67e86

Browse files
authored
Merge branch 'main' into yml-to-yaml-fenced-code
2 parents 2f9df80 + 712a82b commit bd67e86

22 files changed

+515
-17
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,

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+
}

components/Helpfulness.tsx

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { ThumbsdownIcon, ThumbsupIcon } from '@primer/octicons-react'
2+
import { useTranslation } from 'components/hooks/useTranslation'
3+
4+
export const Helpfulness = () => {
5+
const { t } = useTranslation('helpfulness')
6+
7+
return (
8+
<form className="js-helpfulness f5">
9+
<h2 data-help-start data-help-yes data-help-no className="mb-1 f4">
10+
{t`able_to_find`}
11+
</h2>
12+
<p className="f6">
13+
<a href="/github/site-policy/github-privacy-statement">Privacy policy</a>
14+
</p>
15+
<p className="radio-group" data-help-start data-help-yes data-help-no>
16+
<input
17+
hidden
18+
id="helpfulness-yes"
19+
type="radio"
20+
name="helpfulness-vote"
21+
value="Yes"
22+
aria-label={t('yes')}
23+
/>
24+
<label className="btn x-radio-label mr-1" htmlFor="helpfulness-yes">
25+
<ThumbsupIcon size={24} className="color-text-tertiary" />
26+
</label>
27+
<input
28+
hidden
29+
id="helpfulness-no"
30+
type="radio"
31+
name="helpfulness-vote"
32+
value="No"
33+
aria-label={t`no`}
34+
/>
35+
<label className="btn x-radio-label" htmlFor="helpfulness-no">
36+
<ThumbsdownIcon size={24} className="color-text-tertiary" />
37+
</label>
38+
</p>
39+
<p className="color-text-secondary f6" hidden data-help-yes>
40+
{t('yes_feedback')}
41+
</p>
42+
<p className="color-text-secondary f6" hidden data-help-no>
43+
{t('no_feedback')}
44+
</p>
45+
<input type="text" className="d-none" name="helpfulness-token" aria-hidden="true" />
46+
<p hidden data-help-no>
47+
<label className="d-block mb-1 f6" htmlFor="helpfulness-comment">
48+
<span>{t('comment_label')}</span>
49+
<span className="text-normal color-text-tertiary float-right ml-1">{t('optional')}</span>
50+
</label>
51+
<textarea
52+
className="form-control input-sm width-full"
53+
name="helpfulness-comment"
54+
id="helpfulness-comment"
55+
></textarea>
56+
</p>
57+
<p>
58+
<label className="d-block mb-1 f6" htmlFor="helpfulness-email" hidden data-help-no>
59+
{t('email_label')}
60+
<span className="text-normal color-text-tertiary float-right ml-1">{t('optional')}</span>
61+
</label>
62+
<input
63+
type="email"
64+
className="form-control input-sm width-full"
65+
name="helpfulness-email"
66+
id="helpfulness-email"
67+
placeholder={t('email_placeholder')}
68+
hidden
69+
data-help-yes
70+
data-help-no
71+
/>
72+
</p>
73+
<p className="text-right" hidden data-help-yes data-help-no>
74+
<button type="submit" className="btn btn-sm">
75+
{t('send')}
76+
</button>
77+
</p>
78+
<p className="color-text-secondary f6" hidden data-help-end>
79+
{t('feedback')}
80+
</p>
81+
</form>
82+
)
83+
}

components/ScrollButton.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { ChevronUpIcon } from '@primer/octicons-react'
2+
3+
export const ScrollButton = () => {
4+
return (
5+
<button className="arrow-for-scrolling-top" id="js-scroll-top">
6+
<ChevronUpIcon />
7+
</button>
8+
)
9+
}

components/SmallFooter.tsx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { MarkGithubIcon } from '@primer/octicons-react'
2+
import { useTranslation } from 'components/hooks/useTranslation'
3+
4+
export const SmallFooter = () => {
5+
const { t } = useTranslation('footer')
6+
return (
7+
<footer className="py-6 text-small">
8+
<div className="container-xl d-flex px-3 px-md-6">
9+
<ul className="d-flex list-style-none flex-wrap flex-justify-center flex-xl-justify-start">
10+
<li className="d-flex mr-xl-3 color-text-secondary">
11+
<MarkGithubIcon className="mr-2 mr-xl-3" size={20} />
12+
<span>&copy; {new Date().getFullYear()} GitHub, Inc.</span>
13+
</li>
14+
<li className="ml-3">
15+
<a href="/github/site-policy/github-terms-of-service">{t`terms`}</a>
16+
</li>
17+
<li className="ml-3">
18+
<a href="/github/site-policy/github-privacy-statement">{t`privacy`} </a>
19+
</li>
20+
<li className="ml-3">
21+
<a href="https://github.com/security">{t`product.links.security`}</a>
22+
</li>
23+
<li className="ml-3">
24+
<a href="https://www.githubstatus.com/">{t`support.links.status`}</a>
25+
</li>
26+
<li className="ml-3">
27+
<a href="/">{t`support.links.help`}</a>
28+
</li>
29+
<li className="ml-3">
30+
<a href="https://support.github.com">{t`support.links.contact_github`}</a>
31+
</li>
32+
<li className="ml-3">
33+
<a href="https://github.com/pricing">{t`product.links.pricing`}</a>
34+
</li>
35+
<li className="ml-3">
36+
<a href="/developers">{t`platform.links.developer_api`}</a>
37+
</li>
38+
<li className="ml-3">
39+
<a href="https://services.github.com/">{t`support.links.training`}</a>
40+
</li>
41+
<li className="ml-3">
42+
<a href="https://github.com/about">{t`company.links.about`}</a>
43+
</li>
44+
</ul>
45+
</div>
46+
</footer>
47+
)
48+
}

components/Support.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { PeopleIcon, CommentDiscussionIcon } from '@primer/octicons-react'
2+
3+
import { useTranslation } from 'components/hooks/useTranslation'
4+
import { useVersion } from 'components/hooks/useVersion'
5+
6+
export const Support = () => {
7+
const { isEnterprise } = useVersion()
8+
const { t } = useTranslation('support')
9+
10+
return (
11+
<div>
12+
<h3 className="mb-2 f4">{t`still_need_help`}</h3>
13+
<a id="ask-community" href="https://github.community" className="btn btn-outline mr-4 mt-2">
14+
<PeopleIcon size="small" className="octicon mr-1" />
15+
{t`ask_community`}
16+
</a>
17+
<a
18+
id="contact-us"
19+
href={
20+
isEnterprise
21+
? 'https://enterprise.github.com/support'
22+
: 'https://support.github.com/contact'
23+
}
24+
className="btn btn-outline mt-2"
25+
>
26+
<CommentDiscussionIcon size="small" className="octicon mr-1" />
27+
{t`contact_support`}
28+
</a>
29+
</div>
30+
)
31+
}

components/SupportSection.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Helpfulness } from 'components/Helpfulness'
2+
import { Contribution } from 'components/Contribution'
3+
import { Support } from 'components/Support'
4+
import { useMainContext } from './context/MainContext'
5+
import { useVersion } from 'components/hooks/useVersion'
6+
7+
export const SupportSection = () => {
8+
const { currentVersion } = useVersion()
9+
const { enterpriseServerReleases } = useMainContext()
10+
11+
const isDeprecated =
12+
enterpriseServerReleases.isOldestReleaseDeprecated &&
13+
currentVersion.includes(enterpriseServerReleases.oldestSupported)
14+
15+
return (
16+
<section className="mt-lg-9 py-7 px-3 px-md-6 no-print color-bg-tertiary">
17+
<div className="container-xl gutter-lg-spacious clearfix">
18+
<div className="col-12 col-lg-6 col-xl-4 mb-6 mb-xl-0 float-left">
19+
{!isDeprecated && <Helpfulness />}
20+
</div>
21+
<div className="col-12 col-lg-6 col-xl-4 mb-6 mb-xl-0 float-left">
22+
{!isDeprecated && <Contribution />}
23+
</div>
24+
<div className="col-12 col-lg-12 col-xl-4 float-left">
25+
<Support />
26+
</div>
27+
</div>
28+
</section>
29+
)
30+
}

0 commit comments

Comments
 (0)