Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 83a390f

Browse files
authored
Merge pull request #2 from nodejs/master
Rebase master
2 parents 4926511 + 2a46781 commit 83a390f

26 files changed

Lines changed: 793 additions & 238 deletions

File tree

package-lock.json

Lines changed: 24 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Header/__tests__/__snapshots__/header.test.tsx.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ exports[`Tests for Header component renders correctly 1`] = `
2929
className="nav__tabs"
3030
>
3131
<a
32+
activeClassName="active"
3233
className="activeStyleTab"
3334
href="/learn"
3435
partiallyActive={true}
@@ -49,7 +50,7 @@ exports[`Tests for Header component renders correctly 1`] = `
4950
</a>
5051
</li>
5152
<li
52-
className="nav__tabs"
53+
className="nav__tabs only-mobile"
5354
>
5455
<a
5556
className="activeStyleTab only-mobile"

src/components/Header/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ const Header = ({
2929

3030
<ul className="nav__tabs__container">
3131
<li className="nav__tabs">
32-
<Link to="/learn" className="activeStyleTab" partiallyActive>
32+
<Link
33+
to="/learn"
34+
className="activeStyleTab"
35+
activeClassName="active"
36+
partiallyActive
37+
>
3338
Learn
3439
</Link>
3540
</li>
@@ -43,7 +48,7 @@ const Header = ({
4348
Documentation
4449
</a>
4550
</li>
46-
<li className="nav__tabs">
51+
<li className="nav__tabs only-mobile">
4752
<a
4853
className="activeStyleTab only-mobile"
4954
target="_blank"

src/components/Hero/index.tsx

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react';
22
import { Link } from 'gatsby';
33

4-
import { detectOS, UserOS } from '../../util/detectOS';
4+
import { detectOS } from '../../util/detectOS';
5+
import downloadUrlByOS from '../../util/downloadUrlByOS';
56
import { useReleaseHistory, ReleaseData } from '../../hooks/useReleaseHistory';
67

78
import './Hero.scss';
@@ -11,31 +12,6 @@ interface Props {
1112
subTitle: string;
1213
}
1314

14-
function downloadUrlByOS(userOS: UserOS, version: string): string {
15-
const baseURL = `https://nodejs.org/dist/${version}`;
16-
17-
if (userOS === UserOS.MOBILE) {
18-
return baseURL;
19-
}
20-
21-
if (userOS === UserOS.MAC) {
22-
return `${baseURL}/node-${version}.pkg`;
23-
}
24-
25-
if (userOS === UserOS.WIN) {
26-
if (
27-
navigator.appVersion.indexOf('WOW64') !== -1 ||
28-
navigator.appVersion.indexOf('Win64') !== -1
29-
) {
30-
return `${baseURL}/node-${version}-x64.msi`;
31-
}
32-
33-
return `${baseURL}/node-${version}-x86.msi`;
34-
}
35-
36-
return `${baseURL}/node-${version}.tar.gz`;
37-
}
38-
3915
const Hero = ({ title, subTitle }: Props): JSX.Element => {
4016
const userOS = detectOS();
4117
const [currentRelease, ...releases] = useReleaseHistory();

src/components/InstallTabs/InstallTabs.scss

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
.react-tabs {
22
-webkit-tap-highlight-color: transparent;
33

4-
h4 {
5-
margin-top: 0;
6-
}
7-
84
&__tab-list {
95
margin: 0;
106
padding: 0;
@@ -58,19 +54,11 @@
5854
}
5955
}
6056

61-
p {
62-
margin-bottom: 0;
63-
margin-top: var(--space-08);
64-
}
65-
66-
h2 {
67-
margin: var(--space-16) 0;
68-
}
69-
7057
.install {
7158
&__header {
7259
height: 30px;
7360
margin: 0 5px;
61+
font-weight: var(--font-weight-semibold);
7462
&-circles {
7563
height: 100%;
7664
float: left;
@@ -89,23 +77,27 @@
8977
line-height: 30px;
9078
}
9179
}
92-
&__comments {
93-
color: var(--black8);
94-
font-style: italic;
95-
a {
96-
color: var(--color-fill-action);
97-
}
98-
}
9980
&__text {
10081
color: var(--pink5);
101-
padding-left: 6px;
82+
&__line {
83+
margin: var(--space-12) 0;
84+
}
85+
&__no-select {
86+
margin-right: var(--space-12);
87+
-webkit-touch-callout: none; /* iOS Safari */
88+
-webkit-user-select: none; /* Safari */
89+
-khtml-user-select: none; /* Konqueror HTML */
90+
-moz-user-select: none; /* Old versions of Firefox */
91+
-ms-user-select: none; /* Internet Explorer/Edge */
92+
user-select: none;
93+
}
10294
}
10395
&__docs-button {
10496
border-radius: var(--space-04);
10597
padding: var(--space-08) var(--space-16);
10698
position: absolute;
10799
bottom: 2rem;
108-
left: 2rem;
100+
right: 2rem;
109101
}
110102
&__docs-button-text,
111103
&__docs-button-text:hover {
@@ -117,4 +109,16 @@
117109
font-weight: var(--font-weight-semibold);
118110
}
119111
}
112+
.shell-box {
113+
code {
114+
color: var(--pink5);
115+
width: calc(100% - 20px);
116+
line-height: 30px;
117+
> span.install__text__command {
118+
color: #fff;
119+
}
120+
}
121+
background-color: var(--black9);
122+
padding-bottom: 15px;
123+
}
120124
}

0 commit comments

Comments
 (0)