This repository was archived by the owner on Sep 14, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,9 +72,10 @@ class Pin extends React.Component<IPinProps, IPinState> {
7272 data : JSON . stringify ( {
7373 email : this . state . email
7474 } )
75- } ) . then ( function ( ) {
76- this . setState ( { emailSent : true } )
7775 } )
76+ this . setState ( {
77+ emailSent : true
78+ } as IPinState )
7879 }
7980 private triggerChange ( e ) {
8081 this . setState ( {
@@ -137,18 +138,29 @@ class Pin extends React.Component<IPinProps, IPinState> {
137138 if ( this . state . hide ) {
138139 className += ' hide'
139140 }
141+ var desktopOut = ""
142+ if ( ! this . state . emailSent ) {
143+ desktopOut = < div >
144+ < h3 > Email yourself a link to Transit!</ h3 >
145+ < form onSubmit = { this . sendEmail } >
146+ < input value = { this . state . email } type = "email" placeholder = "Email Address" onChange = { this . triggerChange } /> < br />
147+ < button className = "primary" type = "submit" > Send Link</ button >
148+ </ form >
149+ </ div >
150+ } else {
151+ console . log ( "done" )
152+ desktopOut = < div >
153+ < h3 > Thanks! You should receive any email shortly.</ h3 >
154+ < button onClick = { this . triggerClose } > Close</ button >
155+ </ div >
156+ }
140157 return (
141158 < div className = { className } >
142159 < div className = "mobile" >
143160 { output }
144161 </ div >
145162 < div className = "desktop" >
146- < h3 > Email yourself a link to Transit!</ h3 >
147- < form onSubmit = { this . sendEmail } >
148- < input value = { this . state . email } type = "email" placeholder = "Email Address" onChange = { this . triggerChange } /> < br />
149- < button className = "primary" type = "submit" > Send Link</ button >
150- < button onClick = { this . triggerClose } > Close</ button >
151- </ form >
163+ { desktopOut }
152164 </ div >
153165 </ div >
154166 )
You can’t perform that action at this time.
0 commit comments