Created
July 31, 2022 00:39
-
-
Save EverettBerry/254dcf3178055fb248901be22bb51724 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button | |
css={buttonStyle(downloading, true)} | |
disabled={downloading} | |
onClick={async () => { | |
trackDownloadAppClick('mobile') | |
setDownloading(true) | |
setMessage('') | |
const response = await fetch(`${url}/api/download/mobile?email=${emailValue}`) | |
if (!response.ok) { | |
const body = await response.json() | |
setMessage(`Error sending email: ${body.error}`) | |
} else { | |
setMessage(`Email sent to ${emailValue}`) | |
} | |
setDownloading(false) | |
}} | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment