This repository has been archived by the owner on Apr 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add browser extension flow pages. (#835)
* update get started section.
Fixes gitpod-io/website#819
* add browser extension flow pages.
* exclude the extension uninstall page from the build.
* small fixes.
- Loading branch information
1 parent
657738d
commit 06657aa
Showing
27 changed files
with
716 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from 'react' | ||
|
||
import styled from '@emotion/styled' | ||
import { Link } from 'gatsby' | ||
import { colors } from '../styles/variables' | ||
|
||
const StyledMinimalFooter = styled.footer` | ||
padding: 5rem 0 6rem; | ||
text-align: center; | ||
color: ${colors.lightGrey}; | ||
background: ${colors.offWhite}; | ||
p { | ||
margin-bottom: 2rem; | ||
} | ||
a, | ||
.link { | ||
color: inherit; | ||
font-weight: 400; | ||
} | ||
.link { | ||
padding: 0 1rem; | ||
&:not(:last-child) { | ||
border-right: 1px solid; | ||
} | ||
} | ||
` | ||
|
||
const MinimalFooter = () => ( | ||
<StyledMinimalFooter role="footer"> | ||
<div className="row"> | ||
<p>Copyright © <a href="https://www.gitpod.io/" target="_blank" rel="noopener" title="Gitpod">Gitpod</a></p> | ||
<div> | ||
<Link className="link" to="/imprint">Imprint</Link> | ||
<Link className="link" to="/terms">Terms of Service</Link> | ||
<Link className="link" to="/privacy">Privacy Policy</Link> | ||
</div> | ||
</div> | ||
</StyledMinimalFooter> | ||
) | ||
|
||
export default MinimalFooter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
import React, { useState, useEffect } from 'react' | ||
import styled from '@emotion/styled' | ||
import { borders } from '../../styles/variables' | ||
import { Email } from '../../functions/submit-form' | ||
import tick from '../../resources/tick.svg' | ||
|
||
const StyledForm = styled.form` | ||
p { | ||
margin-bottom: 1.2rem; | ||
} | ||
label, textarea { | ||
display: flex; | ||
align-items: center; | ||
} | ||
label { | ||
&:not(:last-of-type) { | ||
margin-bottom: .7rem; | ||
} | ||
} | ||
textarea { | ||
width: 100%; | ||
min-height: 100px; | ||
margin: 1.5rem 0; | ||
padding: 1rem; | ||
border: ${borders.light2}; | ||
border-radius: 3px; | ||
} | ||
input { | ||
margin-right: 1rem; | ||
} | ||
.sucess { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100%; | ||
} | ||
.tick { | ||
margin-bottom: 3rem; | ||
} | ||
` | ||
|
||
const Form = () => { | ||
const [state, setState] = useState<{ | ||
feedback: string | ||
otherFeedback?: string | ||
messageSent?: boolean | ||
}>({ | ||
feedback: '' | ||
}) | ||
|
||
useEffect(() => { | ||
console.log(state) | ||
}, [state]) | ||
|
||
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
const text = e.target.getAttribute('data-text') | ||
setState({ | ||
...state, | ||
feedback: e.target.checked ? state.feedback + `\n${text}` : state.feedback.replace(`\n${text}`, '') | ||
}) | ||
} | ||
|
||
const handleTextAreaChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => { | ||
setState({ | ||
...state, | ||
[e.target.name]: e.target.value | ||
}) | ||
} | ||
|
||
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => { | ||
e.preventDefault() | ||
|
||
const email: Email = { | ||
subject: 'Why did I uninstall the browser extension?', | ||
feedback: state.feedback, | ||
otherFeedback: state.otherFeedback | ||
} | ||
|
||
fetch('/.netlify/functions/submit-form', { | ||
method: 'POST', | ||
body: JSON.stringify(email) | ||
}) | ||
.then(() => | ||
setState({ | ||
...state, | ||
messageSent: true | ||
}) | ||
) | ||
.catch((error) => alert(error)) | ||
} | ||
|
||
return ( | ||
<StyledForm | ||
method="POST" | ||
name="Extension Deletion" | ||
onSubmit={handleSubmit} | ||
> | ||
{ | ||
!state.messageSent ? ( | ||
<> | ||
<input type="hidden" name="form-name" value="extension-deletion" /> | ||
<h3>Why did you uninstall the browser extension?</h3> | ||
<p>Check all that apply:</p> | ||
<div> | ||
<label> | ||
<input type="checkbox" onChange={handleChange} name="usage" data-text="I never used it" /> | ||
I never used it | ||
</label> | ||
<label> | ||
<input type="checkbox" onChange={handleChange} name="configuring" data-text="I have problems configuring my projects" /> | ||
I have problems configuring my projects | ||
</label> | ||
<label> | ||
<input type="checkbox" onChange={handleChange} name="local" data-text="I prefer my local development" /> | ||
I prefer my local development | ||
</label> | ||
<label> | ||
<input type="checkbox" onChange={handleChange} name="expected" data-text="Gitpod isn’t what I expected" /> | ||
Gitpod isn’t what I expected | ||
</label> | ||
<textarea onChange={handleTextAreaChange} aria-label="Do you have any other feedback?" placeholder="Do you have any other feedback?" name="otherFeedback"></textarea> | ||
<button className="btn" disabled={!state.feedback && !state.otherFeedback}>Send</button> | ||
</div> | ||
</>) : ( | ||
<div className="sucess"> | ||
<img src={tick} className="tick" alt="Tick" /> | ||
<h3>Thanks for your Feedback</h3> | ||
</div> | ||
) | ||
} | ||
</StyledForm> | ||
) | ||
} | ||
|
||
export default Form |
Oops, something went wrong.