-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show tooltips when estimations are infinite. Show warning when taking…
… out a bond if bonding bLUSD is not profitable
- Loading branch information
1 parent
e55aa07
commit a25a194
Showing
7 changed files
with
121 additions
and
38 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
23 changes: 23 additions & 0 deletions
23
packages/dev-frontend/src/components/Bonds/views/InfiniteEstimation.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,23 @@ | ||
import { Decimal, Decimalish } from "@liquity/lib-base"; | ||
import { InfoIcon } from "../../InfoIcon"; | ||
import { Card } from "theme-ui"; | ||
import * as l from "../lexicon"; | ||
|
||
type InfiniteEstimateProps = { | ||
estimate: Decimalish; | ||
}; | ||
|
||
export const InfiniteEstimate: React.FC<InfiniteEstimateProps> = ({ estimate, children }) => { | ||
if (estimate.toString() !== Decimal.INFINITY.toString()) return <>{children ?? estimate}</>; | ||
|
||
return ( | ||
<> | ||
{Decimal.INFINITY.toString()} | ||
<InfoIcon | ||
size="xs" | ||
tooltip={<Card variant="tooltip">{l.INFINITE_ESTIMATION.description}</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
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