-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add ExpiringCFGRewardsBanner component to Header (#41)
- Loading branch information
JP
authored
Jan 18, 2024
1 parent
d033bc4
commit 41aa6a3
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Anchor, Box, Card, Paragraph } from 'grommet' | ||
|
||
export const ExpiringCFGRewardsBanner = () => { | ||
const expirationDate = new Date('2024-01-29T15:01') | ||
const currentDateCET = new Date().toLocaleString('en-US', { timeZone: 'CET' }) | ||
const currentDateCETMillis = new Date(currentDateCET).getTime() | ||
|
||
const isExpired = currentDateCETMillis > expirationDate.getTime() | ||
|
||
const formattedExpirationDate = `${expirationDate.toLocaleString('en-US', { | ||
month: 'short', | ||
day: 'numeric', | ||
year: 'numeric', | ||
})} at ${expirationDate.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true }).toLowerCase()}` | ||
|
||
return ( | ||
<Card | ||
margin={{ top: 'medium' }} | ||
pad={{ top: 'xsmall', bottom: 'xsmall', left: 'medium', right: 'medium' }} | ||
style={{ | ||
backgroundColor: '#fff5da', | ||
}} | ||
> | ||
<Box> | ||
<Paragraph> | ||
{isExpired ? ( | ||
`CFG rewards expired on ${formattedExpirationDate} CET.` | ||
) : ( | ||
<> | ||
Claim your rewards until {formattedExpirationDate} CET. After this day, users will not be able to claim | ||
their CFG rewards. Check <Anchor href="/rewards" label="here" /> if there are still unclaimed rewards. | ||
</> | ||
)}{' '} | ||
Read more <Anchor href="https://gov.centrifuge.io/t/cp81-unclaimed-tinlake-rewards/5885/4" label="here" />. | ||
</Paragraph> | ||
</Box> | ||
</Card> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters