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

Commit

Permalink
update get started section.
Browse files Browse the repository at this point in the history
Fixes gitpod-io/website#819
  • Loading branch information
nisarhassan12 committed Oct 26, 2020
1 parent 42f81ca commit 623d713
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 386 deletions.
14 changes: 10 additions & 4 deletions src/components/gitpod-vs-codespaces/Difference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const getBrowser = (userAgent: string) => {
return browser
}

const StyledDifference = styled.section`
const StyledDifference = styled.section<{spacing?: 'small'}>`
padding: ${({spacing}) => spacing === 'small' ? '6rem 0' : ''};
text-align: center;
p {
Expand All @@ -30,18 +31,23 @@ const StyledDifference = styled.section`
}
`

const Difference = () => {
interface DifferenceProps {
title?: string
spacing?: 'small'
}

const Difference = ({title, spacing}: DifferenceProps) => {
const [browser, setBrowser] = useState()

useEffect(() => {
setBrowser(getBrowser(window.navigator.userAgent))
})

return (
<StyledDifference className="pattern-bg">
<StyledDifference className="pattern-bg" spacing={spacing}>
<div className="row">
<h2>
<strong>Want to See the Difference for Yourself?</strong>
<strong>{title ? title : 'Want to See the Difference for Yourself?'}</strong>
</h2>
<p>Add a Gitpod button to your repository.</p>
<a
Expand Down
75 changes: 27 additions & 48 deletions src/components/index/GetStarted.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,14 @@ import styled from '@emotion/styled'
import { sizes } from '../../styles/variables'
import { projects } from '../../contents/projects'
import Project from './Project'
import PrefixInput from './PrefixInput'
import Difference from '../gitpod-vs-codespaces/Difference'

const StyledGetStarted = styled.div`
/* ------------------------------------------- */
/* ----- Section Get Started ----- */
/* ------------------------------------------- */
.get-started {
padding-top: 0;
text-align: center;
h3 {
font-weight: 400;
}
&__prefix {
display: flex;
margin-bottom: 12rem;
text-align: left;
}
h2 + p {
font-size: 2rem;
}
/* ----- Projects ----- */
&__projects {
display: flex;
justify-content: space-between;
Expand All @@ -55,35 +36,33 @@ const StyledGetStarted = styled.div`
`

const GetStarted = () => (
<StyledGetStarted className="row pattern">
<section className="get-started" id="get-started">
<h2>
<strong>Get Started</strong>
</h2>
<p>
Prefix any GitLab, GitHub, or Bitbucket URL with <strong>gitpod.io/#</strong>
</p>

<div className="get-started__prefix">
<PrefixInput />
</div>

<h3>Or Try an Example Project</h3>

<div className="get-started__projects">
{projects.map((project, i) => (
<Project
key={i}
image={<object role="presentation" tabIndex={-1} data={project.image} />}
title={project.title}
githubUrl={project.githubUrl}
gitlabUrl={project.gitlabUrl}
bitbucketUrl={project.bitbucketUrl}
/>
))}
</div>
<section style={{padding: '0'}}>
<Difference
spacing="small"
title="Get Started"
/>
<section
className="get-started"
id="get-started"
style={{padding: '8rem 0'}}
>
<StyledGetStarted className="row">
<h3 style={{textAlign: 'center', fontWeight: 400}}>Or Try an Example Project</h3>
<div className="get-started__projects">
{projects.map((project, i) => (
<Project
key={i}
image={<object role="presentation" tabIndex={-1} data={project.image} />}
title={project.title}
githubUrl={project.githubUrl}
gitlabUrl={project.gitlabUrl}
bitbucketUrl={project.bitbucketUrl}
/>
))}
</div>
</StyledGetStarted>
</section>
</section>
</StyledGetStarted>
)

export default GetStarted
Loading

0 comments on commit 623d713

Please sign in to comment.