-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Centrifuge App: Pending write-off and epoch changes (#1628)
- Loading branch information
1 parent
e2e3525
commit 772aca2
Showing
9 changed files
with
205 additions
and
124 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,41 @@ | ||
import { Banner, Text } from '@centrifuge/fabric' | ||
import * as React from 'react' | ||
import { useLoanChanges, usePoolChanges } from '../utils/usePools' | ||
import { RouterTextLink } from './TextLink' | ||
|
||
export type PoolChangesBannerProps = { | ||
poolId: string | ||
} | ||
const STORAGE_KEY = 'poolChangesBannerDismissed' | ||
|
||
export function PoolChangesBanner({ poolId }: PoolChangesBannerProps) { | ||
const poolChanges = usePoolChanges(poolId) | ||
const { policyChanges } = useLoanChanges(poolId) | ||
const [isOpen, setIsOpen] = React.useState(false) | ||
|
||
React.useEffect(() => { | ||
const dismissed = !!sessionStorage.getItem(STORAGE_KEY) | ||
const hasReady = policyChanges?.some((change) => change.status === 'ready') || poolChanges?.status === 'ready' | ||
if (!dismissed && hasReady) { | ||
setIsOpen(true) | ||
} | ||
}, [poolChanges, policyChanges]) | ||
|
||
function onClose() { | ||
sessionStorage.setItem(STORAGE_KEY, '1') | ||
setIsOpen(false) | ||
} | ||
|
||
return ( | ||
<Banner | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
title={ | ||
<Text as="h3" color="textInverted" variant="heading5"> | ||
There are pending pool changes that can now be enabled{' '} | ||
<RouterTextLink to={`/issuer/${poolId}/configuration`}>here</RouterTextLink> | ||
</Text> | ||
} | ||
/> | ||
) | ||
} |
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
49 changes: 0 additions & 49 deletions
49
centrifuge-app/src/pages/IssuerPool/Configuration/PendingLoanChanges.tsx
This file was deleted.
Oops, something went wrong.
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.