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

Commit 23b0401

Browse files
committed
Revert "WIP"
This reverts commit e0ef58d.
1 parent e0ef58d commit 23b0401

File tree

1 file changed

+10
-68
lines changed
  • src/components/extension-uninstall

1 file changed

+10
-68
lines changed

src/components/extension-uninstall/Form.tsx

Lines changed: 10 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,9 @@ const StyledForm = styled.form`
4848

4949
const Form = () => {
5050
const [state, setState] = useState<{
51-
name?: string
52-
consent?: boolean
53-
email?: string
5451
feedback: string
5552
otherFeedback?: string
5653
messageSent?: boolean
57-
errorMessage?: string
58-
5954
}>({
6055
feedback: ''
6156
})
@@ -83,12 +78,9 @@ const Form = () => {
8378
e.preventDefault()
8479

8580
const email: Email = {
86-
from: {
87-
email: state.email,
88-
name: state.name
89-
},
90-
subject: 'Why did I uninstall the browser extension?' + ' (from ' + state.email + ')',
91-
message: state.feedback + state.otherFeedback
81+
subject: 'Why did I uninstall the browser extension?',
82+
feedback: state.feedback,
83+
otherFeedback: state.otherFeedback
9284
}
9385

9486
fetch('/.netlify/functions/submit-form', {
@@ -111,20 +103,8 @@ const Form = () => {
111103
onSubmit={handleSubmit}
112104
>
113105
{
114-
state.messageSent ? (
115-
<div className="sucess">
116-
<img src={tick} className="tick" alt="Tick" />
117-
<h3>Thanks for your Feedback</h3>
118-
</div>
119-
) : (
106+
!state.messageSent ? (
120107
<>
121-
122-
<div style={{ visibility: 'hidden' }}>
123-
<label>
124-
Don’t fill this out if you're human: <input name="bot-field" />
125-
</label>
126-
</div>
127-
128108
<input type="hidden" name="form-name" value="extension-deletion" />
129109
<h3>Why did you uninstall the browser extension?</h3>
130110
<p>Check all that apply:</p>
@@ -145,53 +125,15 @@ const Form = () => {
145125
<input type="checkbox" onChange={handleChange} name="expected" data-text="Gitpod isn’t what I expected" />
146126
Gitpod isn’t what I expected
147127
</label>
148-
149128
<textarea onChange={handleTextAreaChange} aria-label="Do you have any other feedback?" placeholder="Do you have any other feedback?" name="otherFeedback"></textarea>
150-
151-
<label className="visually-hidden" htmlFor="Name">
152-
{' '}
153-
Name
154-
</label>
155-
<input
156-
autoFocus
157-
name="name"
158-
className="form__input form__input--half"
159-
type="text"
160-
placeholder="Name"
161-
id="Name"
162-
onChange={handleChange}
163-
/>
164-
<label className="visually-hidden" htmlFor="email">
165-
E-Mail
166-
</label>
167-
<input
168-
name="email"
169-
className="form__input form__input--half"
170-
type="email"
171-
placeholder="E-mail"
172-
id="email"
173-
onChange={handleChange}
174-
/>
175-
176-
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', margin: '0px 0px 20px 0px' }}>
177-
178-
<input
179-
name="consent"
180-
id="consent"
181-
type="checkbox"
182-
onChange={handleChange}
183-
style={{ margin: '0px 10px', transform: 'translateY(.5rem)' }}
184-
/>
185-
<label htmlFor="consent">
186-
I consent to having this website store my submitted information so that a support staff can respond to my inquiry.
187-
</label>
188-
</div>
189-
190-
{state.errorMessage ? <p className="error">{state.errorMessage}</p> : null}
191-
192129
<button className="btn" disabled={!state.feedback && !state.otherFeedback}>Send</button>
193130
</div>
194-
</>)
131+
</>) : (
132+
<div className="sucess">
133+
<img src={tick} className="tick" alt="Tick" />
134+
<h3>Thanks for your Feedback</h3>
135+
</div>
136+
)
195137
}
196138
</StyledForm>
197139
)

0 commit comments

Comments
 (0)