-
Notifications
You must be signed in to change notification settings - Fork 643
fix(docs): Docs Interim Updates #1118
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
10f5a7e
fix: connect with us button updates + removing uf references
2af616c
fix: newsletter + ui component back
4edfaad
Temp feedback form component
ocandocrypto-uniswap 978eccf
Temp feedback form component design feedback
ocandocrypto-uniswap 4092003
Design feedback: Search bar + Feedback main container
ocandocrypto-uniswap 2bac502
Footer X Uniswap reference
ocandocrypto-uniswap fe9b14c
docs(api): update trading references to API docs and Developer Portal
ocandocrypto-uniswap 258adb4
docs: Responsive fix
ocandocrypto-uniswap 5e89eae
docs: Mobile menu feedback form
ocandocrypto-uniswap 99010d2
docs: LLMs page update + adding API references to the llm.txt file
ocandocrypto-uniswap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| const HUBSPOT_PORTAL_ID = '47435488' | ||
| const HUBSPOT_FORM_ID = '80c7a6ab-9b96-412f-9469-aa2bc14faa18' | ||
| const HUBSPOT_SUBMIT_URL = `https://api.hsforms.com/submissions/v3/integration/submit/${HUBSPOT_PORTAL_ID}/${HUBSPOT_FORM_ID}` | ||
|
|
||
| function isValidEmail(value: string): boolean { | ||
| return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value) | ||
| } | ||
|
|
||
| export default async function handler(req: any, res: any) { | ||
| if (req.method !== 'POST') { | ||
| return res.status(405).json({ success: false, error: 'Method not allowed' }) | ||
| } | ||
|
|
||
| try { | ||
| const body = typeof req.body === 'string' ? JSON.parse(req.body) : req.body || {} | ||
| const { email, feedbackType, issue, followUp, challenges, docsUsefulness, pageUrl, website } = body | ||
|
|
||
| if (website) return res.status(200).json({ success: true }) // honeypot | ||
| if (!email || !isValidEmail(email)) return res.status(400).json({ success: false, error: 'Invalid email' }) | ||
| if (!feedbackType || !issue) return res.status(400).json({ success: false, error: 'Missing required fields' }) | ||
|
|
||
| const fields = [ | ||
| { name: 'email', value: String(email) }, | ||
| { name: 'type_of_feedback', value: String(feedbackType) }, | ||
| { name: 'whats_the_issue_idea_or_question', value: String(issue) }, | ||
|
ocandocrypto-uniswap marked this conversation as resolved.
|
||
| { name: 'can_we_follow_up_with_you_about_your_feedback', value: followUp ? 'Yes' : 'No' }, | ||
| ...(challenges?.trim() | ||
| ? [{ name: 'what_has_been_the_most_challenging_part_of_building_on_or_integrating_with_uniswap', value: challenges.trim() }] | ||
|
ocandocrypto-uniswap marked this conversation as resolved.
|
||
| : []), | ||
| ...(docsUsefulness?.trim() | ||
| ? [{ name: 'have_you_found_uniswap_docs_to_be_useful', value: docsUsefulness.trim() }] | ||
| : []), | ||
| ] | ||
|
|
||
| const payload = { | ||
| fields, | ||
| legalConsentOptions: { | ||
| consent: { | ||
| consentToProcess: true, | ||
| text: 'By submitting, I agree to Uniswap Labs Terms of Service and Privacy Policy.', | ||
| }, | ||
| }, | ||
| context: { | ||
| pageUri: pageUrl || '', | ||
| pageName: 'Feedback | Uniswap Docs', | ||
| }, | ||
| } | ||
|
|
||
| const hsRes = await fetch(HUBSPOT_SUBMIT_URL, { | ||
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| body: JSON.stringify(payload), | ||
| }) | ||
|
|
||
| if (!hsRes.ok) { | ||
| const hsText = await hsRes.text() | ||
| return res.status(502).json({ success: false, error: 'HubSpot submission failed', details: hsText }) | ||
| } | ||
|
|
||
| return res.status(200).json({ success: true }) | ||
| } catch { | ||
| return res.status(500).json({ success: false, error: 'Internal server error' }) | ||
| } | ||
| } | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.