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

Commit b862558

Browse files
committed
update get started section.
Fixes gitpod-io/website#819
1 parent 42f81ca commit b862558

File tree

10 files changed

+83
-396
lines changed

10 files changed

+83
-396
lines changed

src/components/MoreInfo.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react'
1+
import React, { CSSProperties } from 'react'
22

33
import styled from '@emotion/styled'
44
import { borders, sizes } from '../styles/variables'
@@ -62,9 +62,10 @@ export interface PricingLinksProps {
6262
text?: JSX.Element
6363
links?: JSX.Element
6464
backgroundShouldBeWhite?: boolean
65+
styles?: CSSProperties
6566
}
6667

67-
const PricingLinks = ({ img, title, text, links, backgroundShouldBeWhite }: PricingLinksProps) => {
68+
const PricingLinks = ({ img, title, text, links, backgroundShouldBeWhite, styles }: PricingLinksProps) => {
6869
let Img = img
6970
let Title = title
7071
let Text = text
@@ -91,7 +92,7 @@ const PricingLinks = ({ img, title, text, links, backgroundShouldBeWhite }: Pric
9192
return (
9293
<div
9394
className="pattern-bg"
94-
style={{ marginBottom: backgroundShouldBeWhite ? '' : '10rem', background: backgroundShouldBeWhite ? 'none' : '' }}
95+
style={{ marginBottom: backgroundShouldBeWhite ? '' : '10rem', background: backgroundShouldBeWhite ? 'none' : '', ...styles }}
9596
>
9697
<div className="row">
9798
<StyledPricingLinks>

src/components/gitpod-vs-codespaces/Difference.tsx

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React, { useEffect, useState } from 'react'
22
import styled from '@emotion/styled'
3+
import Chrome from '../../resources/chrome-logo.svg'
4+
import Firefox from '../../resources/firefox-logo.svg'
35

46
const getBrowser = (userAgent: string) => {
57
const browsers = ['Opera', 'Chrome', 'Firefox', 'IE']
@@ -14,36 +16,53 @@ const getBrowser = (userAgent: string) => {
1416
return browser
1517
}
1618

17-
const StyledDifference = styled.section`
19+
const StyledDifference = styled.section<{spacing?: 'small'}>`
20+
padding: ${({spacing}) => spacing === 'small' ? '6rem 0' : ''};
1821
text-align: center;
1922
2023
p {
2124
font-size: 110%;
2225
}
2326
2427
h2 + p {
25-
margin: 3rem 0 2rem;
28+
max-width: 700px;
29+
margin: 3rem auto 2rem;
2630
}
2731
2832
.btn {
2933
margin-bottom: 5rem;
34+
35+
span {
36+
display: flex;
37+
align-items: center;
38+
}
39+
40+
img {
41+
width: 4rem;
42+
margin-right: 2.5rem;
43+
}
3044
}
3145
`
3246

33-
const Difference = () => {
47+
interface DifferenceProps {
48+
title?: string
49+
spacing?: 'small'
50+
}
51+
52+
const Difference = ({title, spacing}: DifferenceProps) => {
3453
const [browser, setBrowser] = useState()
3554

3655
useEffect(() => {
3756
setBrowser(getBrowser(window.navigator.userAgent))
3857
})
3958

4059
return (
41-
<StyledDifference className="pattern-bg">
60+
<StyledDifference className="pattern-bg" spacing={spacing}>
4261
<div className="row">
4362
<h2>
44-
<strong>Want to See the Difference for Yourself?</strong>
63+
<strong>{title ? title : 'Want to See the Difference for Yourself?'}</strong>
4564
</h2>
46-
<p>Add a Gitpod button to your repository.</p>
65+
<p>Install the browser extension which adds a Gitpod button to your GitLab, GitHub and Bitbucket projects to easily spin up a dev environment with a single click.</p>
4766
<a
4867
href={
4968
browser === 'Firefox'
@@ -53,7 +72,13 @@ const Difference = () => {
5372
target="_blank"
5473
className="btn btn--big btn--cta"
5574
>
56-
Install Browser Extension
75+
<span>
76+
<img
77+
src={browser === 'Firefox' ? Firefox : Chrome }
78+
alt={browser}
79+
/>
80+
Add to {browser}
81+
</span>
5782
</a>
5883
<p>
5984
Or prefix any GitLab, GitHub or Bitbucket URL with <strong>gitpod.io/#</strong>

src/components/index/GetStarted.tsx

Lines changed: 27 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,14 @@ import styled from '@emotion/styled'
44
import { sizes } from '../../styles/variables'
55
import { projects } from '../../contents/projects'
66
import Project from './Project'
7-
import PrefixInput from './PrefixInput'
7+
import Difference from '../gitpod-vs-codespaces/Difference'
88

99
const StyledGetStarted = styled.div`
1010
/* ------------------------------------------- */
1111
/* ----- Section Get Started ----- */
1212
/* ------------------------------------------- */
1313
1414
.get-started {
15-
padding-top: 0;
16-
text-align: center;
17-
18-
h3 {
19-
font-weight: 400;
20-
}
21-
22-
&__prefix {
23-
display: flex;
24-
margin-bottom: 12rem;
25-
text-align: left;
26-
}
27-
28-
h2 + p {
29-
font-size: 2rem;
30-
}
31-
32-
/* ----- Projects ----- */
33-
3415
&__projects {
3516
display: flex;
3617
justify-content: space-between;
@@ -55,35 +36,33 @@ const StyledGetStarted = styled.div`
5536
`
5637

5738
const GetStarted = () => (
58-
<StyledGetStarted className="row pattern">
59-
<section className="get-started" id="get-started">
60-
<h2>
61-
<strong>Get Started</strong>
62-
</h2>
63-
<p>
64-
Prefix any GitLab, GitHub, or Bitbucket URL with <strong>gitpod.io/#</strong>
65-
</p>
66-
67-
<div className="get-started__prefix">
68-
<PrefixInput />
69-
</div>
70-
71-
<h3>Or Try an Example Project</h3>
72-
73-
<div className="get-started__projects">
74-
{projects.map((project, i) => (
75-
<Project
76-
key={i}
77-
image={<object role="presentation" tabIndex={-1} data={project.image} />}
78-
title={project.title}
79-
githubUrl={project.githubUrl}
80-
gitlabUrl={project.gitlabUrl}
81-
bitbucketUrl={project.bitbucketUrl}
82-
/>
83-
))}
84-
</div>
39+
<section style={{padding: '0'}}>
40+
<Difference
41+
spacing="small"
42+
title="Get Started"
43+
/>
44+
<section
45+
className="get-started"
46+
id="get-started"
47+
style={{padding: '8rem 0'}}
48+
>
49+
<StyledGetStarted className="row">
50+
<h3 style={{textAlign: 'center', fontWeight: 400}}>Don’t want to open your own repo? Choose an example.</h3>
51+
<div className="get-started__projects">
52+
{projects.map((project, i) => (
53+
<Project
54+
key={i}
55+
image={<object role="presentation" tabIndex={-1} data={project.image} />}
56+
title={project.title}
57+
githubUrl={project.githubUrl}
58+
gitlabUrl={project.gitlabUrl}
59+
bitbucketUrl={project.bitbucketUrl}
60+
/>
61+
))}
62+
</div>
63+
</StyledGetStarted>
64+
</section>
8565
</section>
86-
</StyledGetStarted>
8766
)
8867

8968
export default GetStarted

0 commit comments

Comments
 (0)