Skip to content

Commit

Permalink
483/ display apr (forbole#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
yayay927 authored Dec 3, 2021
1 parent 1b8a1dc commit 246f7eb
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 851 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Unreleased

## Changes
- Display `APR` on title bar ([\#483](https://github.com/forbole/big-dipper-2.0-cosmos/issues/483))
- Add `@dtag` to search bar ([\#554](https://github.com/forbole/big-dipper-2.0-cosmos/issues/554))
- Add `/@dtag` feature ([\#428](https://github.com/forbole/big-dipper-2.0-cosmos/issues/428))
- Add `feegrant` and `authz` messages ([\#481](https://github.com/forbole/big-dipper-2.0-cosmos/issues/481))
- Add `vesting` messages ([\#538](https://github.com/forbole/big-dipper-2.0-cosmos/issues/538))
Expand Down
1 change: 1 addition & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"communityPool": "Community Pool",
"price": "Price",
"inflation": "Inflation",
"apr": "APR",
"success": "Success",
"fail": "Fail",
"filterBy": "Filter By...",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ exports[`screen: Nav/Mobile it renders 1`] = `
N/A
</p>
</div>
<div
className="makeStyles-item"
>
<p
className="MuiTypography-root label MuiTypography-body1"
>
common:apr
</p>
<p
className="MuiTypography-root MuiTypography-body1"
>
0%
</p>
</div>
<div
className="makeStyles-item"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ exports[`screen: Nav/TitleBar hook toggles correctly 1`] = `
N/A
</p>
</div>
<div
className="makeStyles-item"
>
<p
className="MuiTypography-root label MuiTypography-body1"
>
common:apr
</p>
<p
className="MuiTypography-root MuiTypography-body1"
>
0%
</p>
</div>
<div
className="makeStyles-item"
>
Expand Down Expand Up @@ -98,6 +112,20 @@ exports[`screen: Nav/TitleBar it renders 1`] = `
N/A
</p>
</div>
<div
className="makeStyles-item"
>
<p
className="MuiTypography-root label MuiTypography-body1"
>
common:apr
</p>
<p
className="MuiTypography-root MuiTypography-body1"
>
0%
</p>
</div>
<div
className="makeStyles-item"
>
Expand Down
5 changes: 5 additions & 0 deletions src/components/nav/components/title_bar/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const formatMarket = (data: {
communityPool: TokenUnit;
supply: TokenUnit;
inflation: number;
apr: number;
}) => {
const marketCap = data.marketCap !== null ? `$${formatNumber(data.marketCap.toString(), 2)}` : 'N/A';

Expand All @@ -14,6 +15,10 @@ export const formatMarket = (data: {
key: 'marketCap',
data: marketCap,
},
{
key: 'apr',
data: `${formatNumber(Big(data.apr).times(100).toPrecision(), 2)}%`,
},
{
key: 'inflation',
data: `${formatNumber(Big(data.inflation).times(100).toPrecision(), 0)}%`,
Expand Down
Loading

0 comments on commit 246f7eb

Please sign in to comment.