Added timeago + correct refresh of the account page after transaction

This commit is contained in:
Andrew Revinsky (DART)
2016-03-22 21:05:10 +03:00
parent d55ff55e96
commit faa4027305
3 changed files with 6 additions and 3 deletions

View File

@@ -66,6 +66,7 @@
"react-router-bootstrap": "^0.20.1",
"react-router-redux": "^3.0.0",
"react-select": "^0.9.1",
"react-timeago": "^2.2.1",
"redux": "^3.0.2",
"redux-batched-subscribe": "^0.1.4",
"redux-logger": "^2.6.0",

View File

@@ -4,7 +4,7 @@
import React from "react";
import Spinner from "react-loader";
import * as BS from "react-bootstrap";
import TimeAgo from 'react-timeago';
import { Money } from './Money';
import AccountInfo from './AccountInfo';
@@ -29,7 +29,7 @@ export class TransfersTable extends React.Component {
date = null,
status = ''
}, idx) => (<tr key={idx}>
<td>{ date || 'N/a'}</td>
<td><TimeAgo date={date} /></td>
<td><AccountInfo accountId={ fromAccountId } /></td>
<td><AccountInfo accountId={ toAccountId } /></td>
<td><Money amount={ amount } /></td>

View File

@@ -74,7 +74,9 @@ export class Account extends React.Component {
const { accountId } = params;
dispatch(A.makeTransfer(accountId, transfer.form ))
.then(() => {
this.loadAccountInfo();
setTimeout(() => {
this.loadAccountInfo();
}, 500);
});
}