Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2b6797f
test
benhalverson Mar 21, 2020
68bd5d2
Update README.md (#3)
benhalverson Mar 21, 2020
438c216
Merge branch 'staging' of github.com:benhalverson/nodejs.dev into sta…
benhalverson Apr 26, 2020
e8c7462
Merge branch 'staging' of github.com:nodejs/nodejs.dev into staging
benhalverson Apr 27, 2020
845a771
feat(homepage): Added how to isntall tabs
benhalverson Apr 27, 2020
943c974
refactor(homepage): Refactored some styling for the install tabs
benhalverson Apr 27, 2020
a1560de
test(install tabs): Added a snapshot for a the installTabs component
benhalverson Apr 27, 2020
d67417c
refactor(install tabs): More styling for the install text
benhalverson Apr 27, 2020
c9b815f
docs(readme): Remove random test2 text from readme
benhalverson Apr 27, 2020
f6c96a7
Merge branch 'staging' into install-tabs
benhalverson Apr 28, 2020
5d8f3a6
Merge branch 'staging' of github.com:nodejs/nodejs.dev into install-tabs
benhalverson May 6, 2020
049e507
feat(install-tabs): Styling the tabs
benhalverson May 6, 2020
0d548b4
test(snapshot): Updated snapshot for install-tabs component
benhalverson May 6, 2020
6c003aa
test
benhalverson Mar 21, 2020
4dc2225
Update README.md (#3)
benhalverson Mar 21, 2020
ebcc895
feat(homepage): Added how to isntall tabs
benhalverson Apr 27, 2020
59eacf2
refactor(homepage): Refactored some styling for the install tabs
benhalverson Apr 27, 2020
9e8355a
test(install tabs): Added a snapshot for a the installTabs component
benhalverson Apr 27, 2020
41d4520
refactor(install tabs): More styling for the install text
benhalverson Apr 27, 2020
382df04
docs(readme): Remove random test2 text from readme
benhalverson Apr 27, 2020
45f778e
feat(install-tabs): Styling the tabs
benhalverson May 6, 2020
28e032e
test(snapshot): Updated snapshot for install-tabs component
benhalverson May 6, 2020
0304ad7
Merge branch 'install-tabs' of github.com:benhalverson/nodejs.dev int…
benhalverson May 6, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@emotion/core": "^10.0.7",
"@smotaal.io/dark-mode-controller": "<0.5",
"@types/react-helmet": "^5.0.15",
"@types/react-tabs": "2.3.1",
"dotenv": "^8.2.0",
"emotion": "^10.0.27",
"emotion-server": "^10.0.27",
Expand All @@ -33,7 +34,8 @@
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-emotion": "^10.0.0",
"react-helmet": "^5.2.0"
"react-helmet": "^5.2.0",
"react-tabs": "3.1.0"
},
"keywords": [
"gatsby",
Expand Down
110 changes: 110 additions & 0 deletions src/components/installTabs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import React from 'react';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
import '../styles/install-tabs.scss';
import { Link } from 'gatsby';

const InstallTabs = (): JSX.Element => {
return (
<Tabs>
<TabList>
<Tab>Mac OS</Tab>
<Tab>Windows</Tab>
<Tab>Ubuntu / Debian</Tab>
</TabList>

<TabPanel>
<div>
<p>
Download the <Link to="/download">macOS Installer</Link> directly
from the nodejs.org web site.
</p>
<h2>Alternatives</h2>
<p>
Using{' '}
<a href="https://brew.sh" target="_blank" rel="noopener noreferrer">
Homebrew
</a>
</p>
<code className="install__text">brew install node</code>
<p>
Using{' '}
<a
href="https://www.macports.org"
target="_blank"
rel="noopener noreferrer"
>
Macports
</a>
</p>

<code className="install__text">port install nodejs14</code>
<p>
Using{' '}
<a
href="https://github.com/nvm-sh/nvm"
target="_blank"
rel="noopener noreferrer"
>
nvm
</a>
</p>
<code className="install__text">
curl -o-
https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh |
bash
</code>
{/* TODO when the new docs page is ready link to that page. */}
<button type="button">
<a
className="install__docs-button"
href="https://nodejs.org/en/download/package-manager/#macos"
target="_blank"
rel="noopener noreferrer"
>
Read documentation
</a>
</button>
</div>
</TabPanel>
<TabPanel>
<div>
<p>
Download the <Link to="/download">Windows Installer</Link> directly
from the nodejs.org web site.
</p>
<h2>Alternatives</h2>
<p> Using Chocolatey:</p>
<code className="install__text">cinst nodejs</code>
<p>Using Scoop:</p>
<code className="install__text">scoop install nodejs</code>
<button type="button">
<a
className="install__docs-button"
href="https://nodejs.org/en/download/package-manager/#windows"
target="_blank"
rel="noopener noreferrer"
>
Read documentation
</a>
</button>
</div>
</TabPanel>
<TabPanel>
<div>
<h2>
Debian and Ubuntu based Linux distributions, Enterprise Linux/Fedora
and Snap packages
</h2>
<p>
<a href="https://github.com/nodesource/distributions/blob/master/README.md">
Node.js binary distributions
</a>{' '}
are available from NodeSource.
</p>
</div>
</TabPanel>
</Tabs>
);
};

export default InstallTabs;
7 changes: 6 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';
import { Link } from 'gatsby';

import Hero from '../components/Hero';
import Layout from '../components/Layout';

import '../util/konami';

import '../styles/index.scss';
Expand All @@ -15,6 +17,7 @@ import logoImg2 from '../images/logos/linkedin-logo.svg';
import logoImg3 from '../images/logos/microsoft-logo.svg';
import logoImg4 from '../images/logos/netflix-logo.svg';
import logoImg5 from '../images/logos/paypal-logo.svg';
import InstallTabs from '../components/installTabs';

export default function Index(): JSX.Element {
const title = 'Run JavaScript Everywhere.';
Expand All @@ -28,7 +31,9 @@ export default function Index(): JSX.Element {
<Hero title={title} subTitle={subTitle} />

<section className="node-demo-container">
<div className="node-demo" />
<div className="node-demo">
<InstallTabs />
</div>
<img className="leafs-front" src={leafsIllustrationFront} alt="" />
<img className="leafs-middle" src={leafsIllustrationMiddle} alt="" />
<img className="leafs-back" src={leafsIllustrationBack} alt="" />
Expand Down
78 changes: 78 additions & 0 deletions src/styles/install-tabs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.react-tabs {
-webkit-tap-highlight-color: transparent;

&__tab-list {
margin: 0 0 10px;
padding: 0;
text-align: center;
}

&__tab {
display: inline-block;
border: 1px solid transparent;
border-bottom: none;
bottom: -1px;
position: relative;
list-style: none;
padding: 6px 12px;
background: lighten($color: #2c3437, $amount: 20);
cursor: pointer;
height: 32px;
width: 167px;
text-align: center;

&--selected {
background: var(--black9);
border-color: var(--color-border-primary);
color: #fff;
border-radius: 5px 5px 0 0;
}

&:focus {
box-shadow: 0 0 5px hsl(208, 99%, 50%);
border-color: hsl(208, 99%, 50%);
outline: none;

&:after {
content: '';
position: absolute;
height: 5px;
left: -4px;
right: -4px;
bottom: -5px;
background: var(--black0);
}
}
}

&__tab-panel {
display: none;

&--selected {
display: block;
}
}

p {
margin-bottom: 5px;
padding-left: 10px;
padding-top: 3px;
}
.install__text {
color: var(--pink6);
padding-left: 6px;
}
.install__docs-button,
.install__docs-button:hover {
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
box-sizing: border-box;
width: 17rem;
height: 4rem;
color: var(--black6);
margin: 0 var(--space-16);
font-weight: var(--font-weight-semibold);
}
}
Loading