Skip to content

feat(footer): use US Terms of Service and Privacy Policy for US users - #1307

Merged
twosugar merged 1 commit into
mainfrom
feat/us-footer-legal-links
Oct 26, 2026
Merged

twosugar merged 1 commit into
mainfrom
feat/us-footer-legal-links

Conversation

@twosugar

Copy link
Copy Markdown
Collaborator

Problem

The site footer (Footer.tsx) and the docs page footer (DocFooter.astro) always link Terms of Service / Privacy Policy to the SG support pages, including for Longbridge US users.

Change

For US users — same isUSUser() rule as pricing (#1306: logged in → US app_id; else region cookie; else x-ip-region from /api/_ping) — the two links point to the Longbridge US PDFs:

Both URLs are defined once as US_LEGAL_LINKS in @longbridge/openapi-utils.

  • Footer.tsx (hydrated island): picks the href from isUSUser().
  • DocFooter.astro (static): the two links carry data-legal="terms|privacy"; a small client script swaps the href on astro:page-load when the visitor is a US user.

Non-US users keep the current SG links.

Verification (local dev)

Case Site footer (/) Docs footer (/docs)
region=US US Terms / Privacy PDFs US Terms / Privacy PDFs
region=hk longbridge.com/sg/support/... (unchanged) unchanged

Both PDF URLs return 200 application/pdf. oxlint clean on the changed files.

The matching change for the dashboard / authorize pages is in longbridge/developers-website-private.

🤖 Generated with Claude Code

The site footer and the docs page footer always linked to the SG
support pages. For US users (same isUSUser() rule as pricing) they now
link to the Longbridge US PDFs, defined once as US_LEGAL_LINKS in
@longbridge/openapi-utils.

DocFooter.astro is rendered statically, so the two links carry a
data-legal marker and a small client script swaps their href on
astro:page-load when the visitor is a US user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@twosugar
twosugar force-pushed the feat/us-footer-legal-links branch from 9831404 to 93dbf0c Compare October 26, 2026 07:43
@twosugar
twosugar merged commit f9a4d94 into main Oct 26, 2026
2 checks passed
@twosugar
twosugar deleted the feat/us-footer-legal-links branch October 26, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant