Skip to content

Commit

Permalink
Add info to current delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBenc committed Nov 23, 2020
1 parent d54d9bb commit ed32c81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {h} from 'preact'
import ErrorBanner from '../login/errorBanner'

const SaturationErrorBanner = () => {
const message = 'One of the pool you are delegating to is saturated.'
const message =
'The pool you are delegating to is saturated. Delegate to another pool to get the most rewards.'
return (
<a style={'width: 100%;margin-bottom: 20px;'}>
<ErrorBanner message={message} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import printAda from '../../../helpers/printAda'
import {Lovelace} from '../../../state'
import {LinkIconToPool} from './common'
import {EpochDateTime} from '../common'
import roundNumber from './../../../helpers/roundNumber'

const SaturationInfo = (pool) => {
const saturationPercentage = roundNumber(pool.saturatedPercentage * 100, 2)
return <div className="current-delegation-id">Saturation percentage: {saturationPercentage}%</div>
}

const CurrentDelegationPage = ({
pool,
Expand All @@ -30,9 +36,11 @@ const CurrentDelegationPage = ({
<div className="current-delegation-id">
Fixed cost: {printAda(parseInt(pool.fixedCost, 10) as Lovelace)}
</div>
{pool.roa !== '0' && <div className="current-delegation-id">ROA: {pool.roa}</div>}
{SaturationInfo(pool)}
<div className="current-delegation-id">
{'Homepage: '}
<a href={pool.homepage}>{pool.homepage}</a>
<a href={pool.url}>{pool.url}</a>
</div>
<div className="current-delegation-id">
{'View on '}
Expand Down

0 comments on commit ed32c81

Please sign in to comment.