@@ -5,6 +5,7 @@ import { useAppState, useActions, useEffects } from 'app/overmind';
55import { InputText } from 'app/components/dashboard/InputText' ;
66import { InputSelect } from 'app/components/dashboard/InputSelect' ;
77import { StyledButton } from 'app/components/dashboard/Button' ;
8+ import track from '@codesandbox/common/lib/utils/analytics' ;
89
910const ROLE_OPTIONS = [
1011 { value : 'frontend' , label : 'Frontend developer' } ,
@@ -112,7 +113,10 @@ export const Onboarding = () => {
112113 gap = { 6 }
113114 onSubmit = { e => {
114115 e . preventDefault ( ) ;
115-
116+ track ( 'Create Account - Finalize SignUp' , {
117+ codesandbox : 'V1' ,
118+ event_source : 'UI' ,
119+ } ) ;
116120 finalizeSignUp ( {
117121 username : newUsername ,
118122 name : newDisplayName ,
@@ -133,7 +137,13 @@ export const Onboarding = () => {
133137 setLoadingUserName ( false ) ;
134138 } }
135139 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+ } }
137147 isInvalid = { pendingUser . valid === false }
138148 aria-invalid = { ! pendingUser . valid ? true : undefined }
139149 aria-describedby = { ! pendingUser . valid ? 'user-error' : undefined }
@@ -151,7 +161,13 @@ export const Onboarding = () => {
151161 name = "displayname"
152162 label = "Display name"
153163 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+ } }
155171 required
156172 />
157173
@@ -162,7 +178,13 @@ export const Onboarding = () => {
162178 options = { ROLE_OPTIONS }
163179 placeholder = "Please select an option"
164180 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+ } }
166188 required
167189 />
168190
@@ -173,7 +195,13 @@ export const Onboarding = () => {
173195 options = { USAGE_OPTIONS }
174196 placeholder = "Please select an option"
175197 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+ } }
177205 required
178206 />
179207 </ Stack >
0 commit comments