-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
|
Looks good. Couple of things we could review in this PR:
|
@@ -24,7 +26,7 @@ export default function CanUserClaimMessage({ hasClaims, isAirdropOnly }: ClaimI | |||
<Trans> | |||
Thank you for being a supporter of CowSwap and the CoW protocol. As an important member of the CowSwap | |||
Community you may claim vCOW to be used for voting and governance. You can claim your tokens until{' '} | |||
<i>XX-XX-XXXX - XX:XX GMT</i> | |||
<i>{end && new Date(end).toLocaleString()}</i> |
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.
If end
(useAirdropDeadline) has reached the deadline, does hasClaims
return false
? Just to see what we'd return in different scenarios:
- Deadline ended > but user has unclaimed claims.
- Deadlined ended > User has claimed all claims.
- Deadline still open > but user has claimed all their claims.
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 agree with @biocom - we should create another fn to handle states:
function _getHumanReadableClaimDeadline(end: number) {
const now = Date.now()
if (end > now) {
contextString = 'Unfortunately your claim opportunity time is in the past. Your free claim opportunities expired on'
} else {
contextString = 'As an important member of the CowSwap Community you may claim vCOW to be used for voting and governance. You can claim your tokens until'
}
return contextString + ' ' + new Date(end).toLocaleString()
}
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.
If end (useAirdropDeadline) has reached the deadline, does hasClaims return false? Just to see what we'd return in different scenarios:
Yes (eventually). We are currently removing the claimable options from the list. So this flag would be reevaluated every block. Its possible theres a brief moment users see this flag to true, and the time expired. However, is not too important in this case
Deadline ended > but user has unclaimed claims.
hasClaims = false
Deadlined ended > User has claimed all claims.
hasClaims = false
Deadline still open > but user has claimed all their claims.
hasClaims = false
@anxolin and @alfetopito approving and merging but let's consider #2183 |
Changes under the current PR LGTM! |
Summary
Follow up to #2158 adding the claim deadline to airdrop only claims

@biocom please style as you see fit. Feel free to adjust also the format used, or if you want to show the countdown here or not
To Test
Accounts