-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: prototype of referral system in console #142
Conversation
use server actions for now
server actions are confusing and weren't working properly
Website preview 🔗✨ |
and get referral creator working on both pages
also record refcode in the plan gate, too
extracted from original implementation in #142
extracted from original implementation in storacha/console#142
extracted from original implementation in storacha/console#142
extracted from original implementation in storacha/console#142
for some reason the UI isn't updating in the preview env - I suspect this is because we haven't told SWR it needs to refresh and its refresh behavior is more liberal in development
I was thinking the state would be shared between invocations of the hook and that's just not the case! I'd need to introduce a context to get it to work the way I expected. DOH. move to an argument passing style because that's easier than introducing a context, for now
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.
It looks good to me. I added a minor suggestion.
const MAX_REFERRALS = 11 | ||
const MAX_CREDITS = 460 |
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.
suggestion: read it from env.
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.
ah yea - I'm going to come back to this once we have support for actually giving people credits and displaying them - will move to config once that's done!
Co-authored-by: Vicente Olmedo <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [1.16.0](w3console-v1.15.2...w3console-v1.16.0) (2024-12-09) ### Features * add a PNG version of our logo ([#153](#153)) ([2812b27](2812b27)) * point staging env referral link at staging marketing site ([3937048](3937048)) * prototype of referral system in console ([#142](#142)) ([6f760fe](6f760fe)) * referrals tweaks ([#155](#155)) ([7e58678](7e58678)) * update TOS links to point to the Storacha docs ([#148](#148)) ([68d09b5](68d09b5)) ### Bug Fixes * use the correct referral URL ([#149](#149)) ([bc29a2b](bc29a2b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
This PR spikes out a referral system that stores data in Cloudflare's D1. It allows anonymous or logged-in users to create referral codes associated with their email addresses, and records the referral code a user used to sign up for an account. It does not implement the discounts and other rewards associated with the referral system - these are expected to be handled manually in the first released version and implemented as automated systems later, so are a non-goal of this PR.
Referrals service
The referrals service has been extracted to its own worker:
storacha/referrals-service#1
User Experience
The UX is just about dialed in - need to do a pass on the copy and some minor layout stuff, but if you have any thoughts on the big picture now is a great time to chime in!
TODOs