Skip to content
Snippets Groups Projects

chore: update master with latests fixes and features from develop

Merged Bartłomiej Górnicki requested to merge develop into master
1 file
+ 2
60
Compare changes
  • Side-by-side
  • Inline
/* eslint react/prop-types: 0 */
import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import tt from 'counterpart';
import { List } from 'immutable';
import SavingsWithdrawHistory from 'app/components/elements/SavingsWithdrawHistory';
import TransferHistoryRow from 'app/components/cards/TransferHistoryRow';
import TimeAgoWrapper from 'app/components/elements/TimeAgoWrapper';
import {
numberWithCommas,
vestingSteem,
delegatedSteem,
powerdownSteem,
@@ -16,20 +10,7 @@ import {
} from 'app/utils/StateFunctions';
import WalletSubMenu from 'app/components/elements/WalletSubMenu';
import shouldComponentUpdate from 'app/utils/shouldComponentUpdate';
import Tooltip from 'app/components/elements/Tooltip';
import { FormattedHTMLMessage } from 'app/Translator';
import {
LIQUID_TOKEN,
LIQUID_TICKER,
DEBT_TOKENS,
VESTING_TOKEN,
} from 'app/client_config';
import * as transactionActions from 'app/redux/TransactionReducer';
import * as globalActions from 'app/redux/GlobalReducer';
import * as userActions from 'app/redux/UserReducer';
import DropdownMenu from 'app/components/elements/DropdownMenu';
const assetPrecision = 1000;
class Delegations extends React.Component {
constructor() {
@@ -41,23 +22,13 @@ class Delegations extends React.Component {
this.props.getVestingDelegations(
this.props.account.get('name'),
(err, res) => {
debugger;
this.props.setVestingDelegations(res);
}
);
}
render() {
const {
convertToSteem,
price_per_steem,
savings_withdraws,
account,
currentUser,
open_orders,
vestingDelegations,
} = this.props;
const gprops = this.props.gprops.toJS();
const { account, currentUser, vestingDelegations } = this.props;
// do not render if account is not loaded or available
if (!account) return null;
@@ -65,10 +36,6 @@ class Delegations extends React.Component {
// do not render if state appears to contain only lite account info
if (!account.has('vesting_shares')) return null;
const vesting_steem = vestingSteem(account.toJS(), gprops);
const delegated_steem = delegatedSteem(account.toJS(), gprops);
const powerdown_steem = powerdownSteem(account.toJS(), gprops);
const isMyAccount =
currentUser && currentUser.get('username') === account.get('name');
@@ -121,21 +88,7 @@ class Delegations extends React.Component {
<div className="row">
<div className="column small-12">
{/** history */}
<h4>{tt('userwallet_jsx.history')}</h4>
<div className="secondary">
<span>
{tt(
'transfer_jsx.beware_of_spam_and_phishing_links'
)}
</span>
&nbsp;
<span>
{tt(
'transfer_jsx.transactions_make_take_a_few_minutes'
)}
</span>
</div>
<h4>Delegations</h4>
<table>
<tbody>{delegation_log}</tbody>
</table>
@@ -149,26 +102,15 @@ class Delegations extends React.Component {
export default connect(
// mapStateToProps
(state, ownProps) => {
const price_per_steem = pricePerSteem(state);
const savings_withdraws = state.user.get('savings_withdraws');
const gprops = state.global.get('props');
const sbd_interest = gprops.get('sbd_interest_rate');
const vestingDelegations = state.user.get('vestingDelegations');
console.log(state.user.toJS());
return {
...ownProps,
open_orders: state.market.get('open_orders'),
price_per_steem,
savings_withdraws,
sbd_interest,
gprops,
vestingDelegations,
};
},
// mapDispatchToProps
dispatch => ({
getVestingDelegations: (account, successCallback) => {
debugger;
dispatch(
userActions.getVestingDelegations({ account, successCallback })
);
Loading