Skip to content
This repository was archived by the owner on Sep 14, 2026. It is now read-only.

Commit b384fab

Browse files
committed
thanks you should receive your email shortly
1 parent 929ac95 commit b384fab

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

‎js/views/pin.tsx‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff 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
)

0 commit comments

Comments
 (0)