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 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0bc188
commit 9c75be8
Showing
16 changed files
with
592 additions
and
57 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
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
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 |
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,47 @@ | ||
import React from 'react' | ||
import Sven from '../../resources/sven.png' | ||
import SvenName from '../../resources/sven-signature-style-name.svg' | ||
import styled from '@emotion/styled' | ||
import { colors } from '../../styles/variables' | ||
|
||
const StyledMessage = styled.blockquote` | ||
padding: 4rem 5rem; | ||
background: ${colors.offWhite}; | ||
@media(min-width: 1001px) { | ||
min-width: 400px; | ||
} | ||
.sig { | ||
display: block; | ||
margin-top: 1.5rem; | ||
} | ||
.ceo { | ||
display: flex; | ||
align-items: center; | ||
margin-top: 5rem; | ||
img { | ||
height: 6rem; | ||
margin-right: 1rem; | ||
} | ||
} | ||
` | ||
|
||
const Message = () => ( | ||
<StyledMessage> | ||
<p>Hey there,</p> | ||
<p>It’d be great if you could shortly let us know why you uninstalled the browser extension.</p> | ||
<p>We’d like your feedback to understand how we can make Gitpod more useful. We’re committed to improving it, and we’re hoping to see you soon again. | ||
</p> | ||
<p>Best,</p> | ||
<img src={SvenName} className="sig" alt="Sven" title="Sven" /> | ||
<div className="ceo"> | ||
<img src={Sven} alt="Sven Efftinge" /> | ||
<p>Co-Founder & CEO</p> | ||
</div> | ||
</StyledMessage> | ||
) | ||
|
||
export default Message |
Oops, something went wrong.