Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

account: show incomplete data info when not fully synced #629

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/pages/Account/account.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
width: 1.125rem;
background-size: contain;
background-repeat: no-repeat;
opacity: 0.5;
cursor: pointer;
}

Expand Down Expand Up @@ -116,6 +115,14 @@
background-image: url("../../assets/images/brick-loader.svg");
}
}

&__syncing {
@extend %h4;
@extend %row-nowrap;
align-items: center;
color: $manatee-gray;
font-weight: 500;
}
}

&__domains {
Expand Down
22 changes: 21 additions & 1 deletion app/pages/Account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { connect } from "react-redux";
import Transactions from "../../components/Transactions";
import PhraseMismatch from "../../components/PhraseMismatch";
import ShakedexDeprecated from '../../components/ShakedexDeprecated';
import Tooltipable from '../../components/Tooltipable';
import "./account.scss";
import walletClient from "../../utils/walletClient";
import { displayBalance } from "../../utils/balances";
Expand Down Expand Up @@ -33,6 +34,10 @@ const analytics = aClientStub(() => require("electron").ipcRenderer);
hnsPrice: state.node.hnsPrice,
walletInitialized: state.wallet.initialized,
walletType: state.wallet.type,
isSynchronized: (
state.node.isRunning
&& state.node.chain.progress === 1
),
}),
(dispatch) => ({
fetchWallet: () => dispatch(walletActions.fetchWallet()),
Expand Down Expand Up @@ -66,6 +71,7 @@ export default class Account extends Component {
history: PropTypes.object.isRequired,
walletInitialized: PropTypes.bool.isRequired,
walletType: PropTypes.string.isRequired,
isSynchronized: PropTypes.bool.isRequired,
};

static contextType = I18nContext;
Expand Down Expand Up @@ -170,7 +176,7 @@ export default class Account extends Component {

render() {
const {t} = this.context;
const { isFetching } = this.props;
const { isFetching, isSynchronized } = this.props;

return (
<div className="account">
Expand All @@ -184,6 +190,20 @@ export default class Account extends Component {
<div className="account__transactions">
<div className="account__panel-title">
{t('transactionHistory')}

{!isSynchronized ?
<div className="account__transactions__syncing">
<Tooltipable
tooltipContent={t('incompleteDataUntilSyncDesc')}
>
<div className="account__info-icon" />
</Tooltipable>
<span style={{marginLeft: '0.2rem'}}>
{t('incompleteDataUntilSyncInfo')}
</span>
</div>
: null}

{isFetching && (
<div className="account__transactions__loading">
Loading transactions...
Expand Down
2 changes: 2 additions & 0 deletions app/pages/Auction/domains.scss
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@

&__cta {
@extend %btn-primary;
display: flex;
justify-content: center;
font-weight: 600;
}

Expand Down
2 changes: 2 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@
"inBids": "In bids",
"inFinishedAuctions": "In finished auctions",
"inReveals": "In reveal",
"incompleteDataUntilSyncDesc": "Data displayed is as of the current sync height. As it catches up with newer blocks, all transactions will be picked up and the balance will be accurate.",
"incompleteDataUntilSyncInfo": "May not be up to date until sync is complete",
"inputs": "Inputs",
"invalidAddress": "Invalid Address",
"invalidTransactionFile": "Invalid Transaction File",
Expand Down