-
Notifications
You must be signed in to change notification settings - Fork 18
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
Claim RAD UI #93
Claim RAD UI #93
Conversation
…n address link on Ethereum
Signed-off-by: Philip Stanislaus <6912756+philipstanislaus@users.noreply.github.com>
…link account step
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.
This looks really great Philip!
height?: number | ||
maxWidth?: number | ||
alignRight?: boolean | ||
render: () => React.ReactNode |
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.
I don't understand this. children
is the standard way to pass "inner contents" of an element. Why do you need this render prop, rather than just using the children prop?
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.
Using a function allows conditional evaluation of the arguments to that function. I added it here so we can actually use values we check in the done
property, without needing to check for undefined/null/loading in the arguments again.
Created a small codesandbox for you to play around with – feel free to ping me on Slack to show you what I mean: https://codesandbox.io/s/dreamy-wright-4g97l?file=/src/App.js
claims: null | RewardClaim[] | ||
} | ||
|
||
/** |
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.
I really like how you organised all the ducks and properly documented this inline!
} from './radRewardProofs' | ||
const BN = require('bn.js') | ||
|
||
describe('Proofs', () => { |
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.
👍
* Returns a number rounded to 4 decimals if the value is smaller than 10, and to 0 decimlas otherwise. | ||
* @param num amount with a decimal dot, not in base units | ||
*/ | ||
export const toDynamicPrecision = (num: string) => toPrecision(num, dynamicPrecision(num)) |
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, this can be really useful in other places as well.
…p in rewards page
Thanks for your feedback @offerijns , merging this now and will address all your points in another PR. |
* Add refund utilities for tinlake.js tests, add helper for tx success * Use refund mechanism in all tests * Add claim rad functionality to tinlake.js * Use actual gas price for refunding ETH after tinlake.js tests * Update claim RAD ABI * Fix yield data fetching * Implement reward claims UI * Rename claim RAD contract name * Fix buggy permission check * Add Centrifuge Chain wallet, add functionality to set Centrifuge Chain address link on Ethereum * Fix validation * Improve flow Signed-off-by: Philip Stanislaus <6912756+philipstanislaus@users.noreply.github.com> * Fix compilation errors * Update field names * Add display of claimed rewards on Centrifuge Chain * Add fetching of rad rewards tree from GCP * Refactor user rewards to make them simpler * Add reward collection on Centrifuge Chain * Improve flow and copy for demo of RAD rewards claim * Fix spacing and other bugs * Fix claims * Add explanation if collected/uncollected is higher than earned * Add rad reward claim proofs * Fix hash calculation * Remove system rewards * Update reward claim design * Fix reward collection * Simplify state * Add user current investments and daily rewards * Add system rewards * Fix rewards collected display * Add RAD icon to collect stripe * Remove console.logs * Update copy * Show data for non-investors * Update copy * Update copy * More copy updates * Add hook to detect installed/injected polkadot browser extension * Fix bug caused by checksum casing of Ethereum address * Add rewards to dashboard * Fix loading indicators * Design and copy changes * Remove Total Financed to Date * Small layout fixes * Add reload page after polkadot wallet extension install * Automatically connect polkadot wallet * Add title to rewards page * Replace orange with white RAD rewards box on dashboard * Rename "address" with "account" on rewards UI * Change data types for rewards from strings to BNs/Decimals * Add start investing step for investors without earned rewards before link account step * Add success message to account linking and poll status * Change cent chain link address selection to dropdown * Copy changes * Redesign system rewards * Fix bug that led to wrong allocation of claimed rewards * Fix bug if nonZeroBalanceSince is null * Fix padding * Improve pool title visuals * Copy and layout changes * Remove unused router * Add claim rewards entry to wallet * Copy changes * Fix compilation error * Fix bug that caused linked accounts without investments not showing up in rewards page * Add extrinsic hash to claim UI * Fix decimal issues * Add thousands separators to RAD reward claims * Rename tinlake get cent chain account functions * Improve missing env variable errors Co-authored-by: Jeroen Offerijns <jeroen@offerijns.com> Co-authored-by: Jeroen Offerijns <jeroen@offerijns.com>
No description provided.