1
1
import { useRouter } from 'next/router'
2
2
import { useRef , useState } from 'react'
3
- import { Alert , Heading , Button } from 'theme-ui'
3
+ import { Alert , Button , Text } from 'theme-ui'
4
4
import FormContainer from './form-container'
5
5
import OrganizationInfoForm from './org-form'
6
6
import PersonalInfoForm from './personal-form'
7
7
import { onSubmit } from './submit'
8
- import Callout from './callout'
9
8
import TeenagerOrAdultForm from './teenager-or-adult-form'
10
9
import MultiStepForm from './multi-step-form'
11
10
@@ -18,18 +17,27 @@ export default function ApplicationForm() {
18
17
const requiredFields = {
19
18
// Key: form field name
20
19
// Value: humanize field name used in error message
21
- eventName : 'organization name' ,
22
- eventLocation : 'organization country' ,
23
- eventPostalCode : 'organization zip/postal code' ,
24
- eventDescription : 'organization description' ,
25
20
eventTeenagerLed : 'are you a teenager?' ,
26
- eventPoliticalActivity : "organization's political activity" ,
27
- eventAnnualBudget : 'organization annual budget' ,
21
+ eventName : 'project name' ,
22
+ eventPostalCode : 'project zip/postal code' ,
23
+ eventDescription : 'project description' ,
24
+ eventIsPolitical : "project's political activity" ,
25
+ eventPoliticalActivity : "project's political activity" ,
26
+ eventHasWebsite : 'project website' ,
27
+ eventWebsite : 'project website' ,
28
+ eventAnnualBudget : 'project annual budget' ,
28
29
firstName : 'first name' ,
29
30
lastName : 'last name' ,
30
31
userEmail : 'email' ,
31
32
userPhone : 'phone number' ,
32
- userBirthday : 'birthday'
33
+ userBirthday : 'birthday' ,
34
+ userAddressLine1 : 'address line 1' ,
35
+ userAddressCity : 'city' ,
36
+ userAddressProvince : 'state/province' ,
37
+ userAddressPostalCode : 'ZIP/postal code' ,
38
+ userAddressCountry : 'country' ,
39
+
40
+ referredBy : 'how did you hear about HCB?'
33
41
}
34
42
35
43
const submitButton = (
@@ -66,22 +74,34 @@ export default function ApplicationForm() {
66
74
} )
67
75
}
68
76
>
69
- < MultiStepForm submitButton = { submitButton } >
77
+ < MultiStepForm
78
+ submitButton = { submitButton }
79
+ validationErrors = {
80
+ formError && (
81
+ < Alert bg = "primary" sx = { { mt : 4 } } >
82
+ { formError }
83
+ </ Alert >
84
+ )
85
+ }
86
+ >
70
87
{ /* Step 1 */ }
71
88
< MultiStepForm . Step title = "Let's get started" >
72
- < Callout />
89
+ < Text as = "p" variant = "caption" sx = { { marginBottom : '2rem' } } >
90
+ Fill out this quick application to run your project on HCB. If you
91
+ are a teenager, there is a very high likelihood we will accept your
92
+ project. We just need to collect a few pieces of information first.
93
+ </ Text >
73
94
< TeenagerOrAdultForm requiredFields = { requiredFields } />
74
95
</ MultiStepForm . Step >
75
96
{ /* Step 2 */ }
76
- < MultiStepForm . Step title = "Your organization" >
97
+ < MultiStepForm . Step >
77
98
< OrganizationInfoForm requiredFields = { requiredFields } />
78
99
</ MultiStepForm . Step >
79
100
{ /* Step 3 */ }
80
101
< MultiStepForm . Step title = "Personal details" >
81
102
< PersonalInfoForm requiredFields = { requiredFields } />
82
103
</ MultiStepForm . Step >
83
104
</ MultiStepForm >
84
- { formError && < Alert bg = "primary" > { formError } </ Alert > }
85
105
</ FormContainer >
86
106
)
87
107
}
0 commit comments