This repository has been archived by the owner on Dec 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Kwun/add rewards amount (#325) * fix unjail message * update changelog * show reward amount in the activities * update delegation in 6 decimal places * update changelog * Monika/kava testnet redelegations fix (#373) * Fixed Redelegation List showing on all account pages * Updated CHANGELOG.md * Updated ChainStates.jsx Co-authored-by: Kwun Yeung <kwun@forbole.com> Co-authored-by: Magic Cat <37407870+MonikaCat@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
73 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React, { Component } from 'react'; | ||
import { Card, CardHeader, CardBody, Container, Row, Col, Spinner } from 'reactstrap'; | ||
import numbro from 'numbro'; | ||
import Account from '../components/Account.jsx'; | ||
import { Mongo } from 'meteor/mongo'; | ||
import moment from 'moment'; | ||
import i18n from 'meteor/universe:i18n'; | ||
import Coin from '/both/utils/coins.js'; | ||
|
||
const T = i18n.createComponent(); | ||
|
||
export default class AccountRedelegations extends Component{ | ||
constructor(props){ | ||
super(props); | ||
} | ||
|
||
render(){ | ||
let numRedelegations = this.props.redelegations.length; | ||
return <div> | ||
|
||
<h6>{(numRedelegations > 0 )? numRedelegations : <T>accounts.no</T>}<T>accounts.redelegations</T>{(numRedelegations>1)?<T>accounts.plural</T>:''}</h6> | ||
|
||
{(numRedelegations > 0)?<div className="list overflow-auto"> | ||
<Container fluid> | ||
<Row className="header text-nowrap d-none d-lg-flex"> | ||
<Col md={3}><i className="fas fa-at"></i> <span><T>accounts.redelegatedFrom</T></span></Col> | ||
<Col md={3}><i className="fas fa-at"></i> <span><T>accounts.redelegatedTo</T></span></Col> | ||
<Col md={6}> | ||
<Row> | ||
<Col md={6}><i className="fas fa-piggy-bank"></i> <span><T>accounts.shares</T></span></Col> | ||
<Col md={6}><i className="fas fa-clock"></i> <span><T>accounts.mature</T></span></Col> | ||
</Row> | ||
</Col> | ||
</Row> | ||
{this.props.redelegations.map((r, i) => | ||
<Row key={i} className="delegation-info"> | ||
<Col md={3} className="text-nowrap overflow-auto"><Account address={r.validator_src_address} /></Col> | ||
<Col md={3} className="text-nowrap overflow-auto"><Account address={r.validator_dst_address} /></Col> | ||
<Col md={6}>{r.entries.map((entry,j) => | ||
<Row key={j}> | ||
<Col md={6}> | ||
{new Coin(entry.balance).toString(4)} | ||
</Col> | ||
<Col md={6}> | ||
{moment.utc(entry.completion_time).fromNow()} | ||
</Col> | ||
</Row> | ||
)}</Col> | ||
</Row> | ||
)} | ||
</Container> | ||
</div>:''} | ||
</div> | ||
} | ||
} |