-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds the suggestion page with file upload to GCP #330
base: main
Are you sure you want to change the base?
Conversation
…ld-network/token-dashboard into gcloud-file-upload
…nto gcloud-file-upload
…ld-network/token-dashboard into gcloud-file-upload
…nto gcloud-file-upload
Preview uploaded to https://preview.dashboard.test.threshold.network/gcloud-file-upload/index.html. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left minor comments. Overall LGTM 👍
return fetch(`https://storage.googleapis.com/${bucket}`, { | ||
method: "POST", | ||
body: formData, | ||
}).then((resp) => { | ||
return `https://storage.cloud.google.com/${bucket}/${file.name}` | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already use axios
as a http client see utils/exchangeApi.ts
- we could use it, probably simplify code a little bit. Ofc non-blocking.
return fetch(`https://storage.googleapis.com/${bucket}`, { | ||
method: "POST", | ||
body: formData, | ||
}).then((resp) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe let's add catch
to log any errors and avoid app crashes.
export const useCapture = (eventName: PosthogEvent) => { | ||
export const useCapture = ( | ||
eventName: PosthogEvent, | ||
overrideConsent = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe shouldOverrideConsent
?
suggestion: suggestionText, | ||
}) | ||
|
||
setIsLoading(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably should set the loading indicator to false once we catch an error.
This PR builds the suggestion page according to designs: https://www.figma.com/file/Tx1lZc7us4SqCeAgbt1hBV/Threshold-Dapp?node-id=4251%3A276860&t=ZmBL64H8ytLsbgVf-0
Per UX discussion we've decided to implement an override for posthog capture events so that suggestions can still be submitted to posthog, even if the user has declined the anonymous analytics tracking.
User files are uploaded to the Google cloud bucket which are permission locked for authorized users only. The link to the file is sent to posthog.