Skip to content

Conversation

@fairlighteth
Copy link
Contributor

@fairlighteth fairlighteth commented Oct 24, 2025

Summary

Adds the infrastructure that prepares affiliates for user-facing entry points:

  • ReferralNetworkBanner surfaces a Lingui-backed warning while the modal is open but the wallet is disconnected or on an unsupported chain.
  • ReferralDeepLinkHandler listens for ?ref=CODE query params, sanitises/normalises them, triggers the referral modal, persists the code, fires analytics, and removes the parameter from the URL.
  • referralApi now resolves its base URL via env fallbacks (staging → default) while keeping the timeout configurable.
  • Minor shape tweaks to constants/types keep the branch compiling ahead of the UI slices.

Everything stays unmounted for now; integration happens in later PRs.

To Test

  1. yarn lint

    • Lint passes; new hooks and components comply with ESLint/TS rules
  2. Deep-link smoke test (manual/connect dev tools)

    • Render ReferralProvider + ReferralDeepLinkHandler in Storybook or a sandbox
    • Navigate to /sandbox?ref=MYCODE → Handler sanitises code, opens modal (referral.modalOpen === true), and removes the query param
    • useCowAnalytics().sendEvent receives code_saved with label deeplink
  3. Banner behaviour (manual)

    • With the modal open and wallet disconnected, <ReferralNetworkBanner /> renders the warning copy
    • Connecting a supported wallet hides the banner immediately

Background

This slice deliberately ships headless logic so reviewers can validate the deep-link and banner behaviour before the modal UI is mounted in later branches.

@vercel
Copy link

vercel bot commented Oct 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
cowfi Ready Ready Preview Nov 26, 2025 5:43pm
explorer-dev Ready Ready Preview Nov 26, 2025 5:43pm
swap-dev Ready Ready Preview Nov 26, 2025 5:43pm
widget-configurator Ready Ready Preview Nov 26, 2025 5:43pm
2 Skipped Deployments
Project Deployment Preview Updated (UTC)
cosmos Ignored Ignored Nov 26, 2025 5:43pm
sdk-tools Ignored Ignored Preview Nov 26, 2025 5:43pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/affiliate-ui-6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants