-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/centrifuge/apps into fix-ho…
…lders
- Loading branch information
Showing
51 changed files
with
575 additions
and
291 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
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
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
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
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
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
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
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
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
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
62 changes: 62 additions & 0 deletions
62
centrifuge-app/src/components/ExpiringCFGRewardsBanner.tsx
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,62 @@ | ||
import { Banner, Text } from '@centrifuge/fabric' | ||
import * as React from 'react' | ||
import { useUserRewards } from '../utils/tinlake/useTinlakeRewards' | ||
|
||
export const ExpiringCFGRewardsBanner = () => { | ||
const [isOpen, setIsOpen] = React.useState(true) | ||
const { data } = useUserRewards() | ||
|
||
const hasLinkedRewards = data?.links.some((link) => (link.claimable?.isZero() === true ? false : true)) | ||
const hasUnlinkedRewards = data?.unlinkedRewards?.isZero() === false ? true : false | ||
|
||
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()}` | ||
|
||
if ((hasLinkedRewards || hasUnlinkedRewards) && !isExpired) { | ||
return ( | ||
<Banner | ||
isOpen={isOpen} | ||
onClose={() => setIsOpen(false)} | ||
title={ | ||
<Text as="h3" color="textInverted" variant="heading5"> | ||
Claim your Tinlake Rewards before it is too late. Rewards will expire on {formattedExpirationDate} CET. | ||
After the deadline, users will not be able to claim their CFG rewards. Check{' '} | ||
<Text | ||
target="_blank" | ||
as="a" | ||
href="https://legacy.tinlake.centrifuge.io/rewards" | ||
color="textInverted" | ||
variant="heading5" | ||
display="inline" | ||
textDecoration="underline" | ||
> | ||
here | ||
</Text>{' '} | ||
if you have unclaimed rewards. Read more about the community vote{' '} | ||
<Text | ||
target="_blank" | ||
as="a" | ||
href="https://gov.centrifuge.io/t/cp81-unclaimed-tinlake-rewards/5885/4" | ||
color="textInverted" | ||
variant="heading5" | ||
display="inline" | ||
textDecoration="underline" | ||
> | ||
here | ||
</Text> | ||
. | ||
</Text> | ||
} | ||
/> | ||
) | ||
} | ||
|
||
return null | ||
} |
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
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
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
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
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
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
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
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
Oops, something went wrong.