-
Notifications
You must be signed in to change notification settings - Fork 483
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: add claim button to header #2472
Conversation
Branch preview✅ Deploy successful! |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
src/hooks/useSafeTokenAllocation.ts
Outdated
@@ -126,30 +142,26 @@ const fetchTokenBalance = async (chainId: string, safeAddress: string): Promise< | |||
* The Safe token allocation is equal to the voting power. | |||
* It is computed by adding all vested tokens - claimed tokens + token balance | |||
*/ | |||
const useSafeTokenAllocation = (): [BigNumber | undefined, boolean] => { | |||
export const useSafeTokenBalance = (allocationData?: Vesting[]): AsyncResult<BigNumber> => { |
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.
export const useSafeTokenBalance = (allocationData?: Vesting[]): AsyncResult<BigNumber> => { | |
export const useSafeVotingPower = (allocationData?: Vesting[]): AsyncResult<BigNumber> => { |
Should we rename it to useSafeVotingPower
?
useSafeTokenBalance
sounds to me as if it would just fetch the current balance in a hook.
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've renamed it accordingly in ba34f38.
return false | ||
} | ||
|
||
return !sep5Allocation.isRedeemed |
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.
Like this we would need to make a change once the deadline is reached.
I think also checking if the allocation is expired would fix that.
return !sep5Allocation.isRedeemed | |
return !sep5Allocation.isRedeemed && !sep5Allocation.isExpired |
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've added the extra check in ba34f38.
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.
Looks good 👍 I've tested this with my görli safes.
- The one that is elligible for sep5 had the new button in the header. After redeeming, the button disappears
- The one that is not elligible for sep5 has no button in the header
We discussed this and deemed it fine as is. |
What it solves
Implements claim button in header
How this PR fixes it
The token allocation element in the header now includes a "New allocation" button according to the designs. Clicking it will take you to the claiming app and, providing there is nothing to claim, it should not appear.
How to test it
Open a Safe with an allocation and observe the new button. Claiming should make it dissappear and opening a Safe without an allocation should not show it at all.
Clicking on the button should the following event: "Click on SEP5 allocation button".
Screenshots
Checklist