@@ -5,6 +5,7 @@ import { useAppState, useActions, useEffects } from 'app/overmind';
5
5
import { InputText } from 'app/components/dashboard/InputText' ;
6
6
import { InputSelect } from 'app/components/dashboard/InputSelect' ;
7
7
import { StyledButton } from 'app/components/dashboard/Button' ;
8
+ import track from '@codesandbox/common/lib/utils/analytics' ;
8
9
9
10
const ROLE_OPTIONS = [
10
11
{ value : 'frontend' , label : 'Frontend developer' } ,
@@ -112,7 +113,10 @@ export const Onboarding = () => {
112
113
gap = { 6 }
113
114
onSubmit = { e => {
114
115
e . preventDefault ( ) ;
115
-
116
+ track ( 'Create Account - Finalize SignUp' , {
117
+ codesandbox : 'V1' ,
118
+ event_source : 'UI' ,
119
+ } ) ;
116
120
finalizeSignUp ( {
117
121
username : newUsername ,
118
122
name : newDisplayName ,
@@ -133,7 +137,13 @@ export const Onboarding = () => {
133
137
setLoadingUserName ( false ) ;
134
138
} }
135
139
value = { newUsername }
136
- onChange = { e => setNewUsername ( e . target . value ) }
140
+ onChange = { e => {
141
+ track ( 'Create Account - Set Username' , {
142
+ codesandbox : 'V1' ,
143
+ event_source : 'UI' ,
144
+ } ) ;
145
+ setNewUsername ( e . target . value ) ;
146
+ } }
137
147
isInvalid = { pendingUser . valid === false }
138
148
aria-invalid = { ! pendingUser . valid ? true : undefined }
139
149
aria-describedby = { ! pendingUser . valid ? 'user-error' : undefined }
@@ -151,7 +161,13 @@ export const Onboarding = () => {
151
161
name = "displayname"
152
162
label = "Display name"
153
163
value = { newDisplayName }
154
- onChange = { e => setNewDisplayName ( e . target . value ) }
164
+ onChange = { e => {
165
+ track ( 'Create Account - Set Display Name' , {
166
+ codesandbox : 'V1' ,
167
+ event_source : 'UI' ,
168
+ } ) ;
169
+ setNewDisplayName ( e . target . value ) ;
170
+ } }
155
171
required
156
172
/>
157
173
@@ -162,7 +178,13 @@ export const Onboarding = () => {
162
178
options = { ROLE_OPTIONS }
163
179
placeholder = "Please select an option"
164
180
value = { role }
165
- onChange = { e => setRole ( e . target . value ) }
181
+ onChange = { e => {
182
+ track ( 'Create Account - Set Role' , {
183
+ codesandbox : 'V1' ,
184
+ event_source : 'UI' ,
185
+ } ) ;
186
+ setRole ( e . target . value ) ;
187
+ } }
166
188
required
167
189
/>
168
190
@@ -173,7 +195,13 @@ export const Onboarding = () => {
173
195
options = { USAGE_OPTIONS }
174
196
placeholder = "Please select an option"
175
197
value = { usage }
176
- onChange = { e => setUsage ( e . target . value ) }
198
+ onChange = { e => {
199
+ track ( 'Create Account - Set Usage' , {
200
+ codesandbox : 'V1' ,
201
+ event_source : 'UI' ,
202
+ } ) ;
203
+ setUsage ( e . target . value ) ;
204
+ } }
177
205
required
178
206
/>
179
207
</ Stack >
0 commit comments