Merge pull request #27 from andrerfneves/hotfix/remove-loading-state
Hotfix/remove loading state
This commit is contained in:
commit
42a6a35b98
|
@ -34,6 +34,18 @@ const initialLog = `
|
|||
In order to ensure you are adequately protecting your privacy when using Zcash, please see <https://z.cash/support/security/>.
|
||||
`;
|
||||
|
||||
const defaultState = `
|
||||
\n
|
||||
Block height | 0
|
||||
Connections | 0
|
||||
Network solution rate | 0 Sol/s
|
||||
|
||||
You are currently not mining.
|
||||
To enable mining, add 'gen=1' to your zcash.conf and restart.
|
||||
Since starting this node 0 minutes, 0 seconds ago:
|
||||
- You have validated 0 transactions!
|
||||
`;
|
||||
|
||||
const breakpoints = [1, 4, 7, 10, 13];
|
||||
|
||||
type Props = {};
|
||||
|
@ -44,7 +56,7 @@ type State = {
|
|||
|
||||
export class ConsoleView extends Component<Props, State> {
|
||||
state = {
|
||||
log: '',
|
||||
log: initialLog + defaultState,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
@ -58,7 +70,6 @@ export class ConsoleView extends Component<Props, State> {
|
|||
|
||||
return (
|
||||
<Wrapper>
|
||||
{log ? (
|
||||
<Fragment>
|
||||
<ConsoleImg src={ConsoleSymbol} alt='Zcashd' />
|
||||
{log.split('\n').map((item, idx) => (
|
||||
|
@ -68,9 +79,6 @@ export class ConsoleView extends Component<Props, State> {
|
|||
</Fragment>
|
||||
))}
|
||||
</Fragment>
|
||||
) : (
|
||||
<ConsoleText value='Waiting for daemon logs...' />
|
||||
)}
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import React, { PureComponent, Fragment } from 'react';
|
|||
|
||||
import { WalletSummaryComponent } from '../components/wallet-summary';
|
||||
import { TransactionDailyComponent } from '../components/transaction-daily';
|
||||
import { TextComponent } from '../components/text';
|
||||
|
||||
import type { Transaction } from '../components/transaction-item';
|
||||
|
||||
|
@ -13,7 +14,6 @@ type Props = {
|
|||
shielded: number,
|
||||
transparent: number,
|
||||
error: string | null,
|
||||
isLoading: boolean,
|
||||
zecPrice: number,
|
||||
addresses: string[],
|
||||
transactions: { [day: string]: Transaction[] },
|
||||
|
@ -28,7 +28,6 @@ export class DashboardView extends PureComponent<Props> {
|
|||
render() {
|
||||
const {
|
||||
error,
|
||||
isLoading,
|
||||
total,
|
||||
shielded,
|
||||
transparent,
|
||||
|
@ -40,14 +39,10 @@ export class DashboardView extends PureComponent<Props> {
|
|||
const days = Object.keys(transactions);
|
||||
|
||||
if (error) {
|
||||
return error;
|
||||
return <TextComponent value={error} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
{isLoading ? (
|
||||
'Loading'
|
||||
) : (
|
||||
<Fragment>
|
||||
<WalletSummaryComponent
|
||||
total={total}
|
||||
|
@ -65,8 +60,6 @@ export class DashboardView extends PureComponent<Props> {
|
|||
/>
|
||||
))}
|
||||
</Fragment>
|
||||
)}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
import React, { PureComponent, Fragment } from 'react';
|
||||
|
||||
import { TransactionDailyComponent } from '../components/transaction-daily';
|
||||
import { TextComponent } from '../components/text';
|
||||
|
||||
import type { Transaction } from '../components/transaction-item';
|
||||
|
||||
type Props = {
|
||||
isLoading: boolean,
|
||||
error: string | null,
|
||||
transactions: { [day: string]: Transaction[] },
|
||||
zecPrice: number,
|
||||
|
@ -20,21 +20,17 @@ export class TransactionsView extends PureComponent<Props> {
|
|||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
error, isLoading, transactions, zecPrice,
|
||||
} = this.props;
|
||||
const { error, transactions, zecPrice } = this.props;
|
||||
|
||||
if (error) {
|
||||
return error;
|
||||
return <TextComponent value={error} />;
|
||||
}
|
||||
|
||||
const days = Object.keys(transactions);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
{isLoading
|
||||
? 'Loading'
|
||||
: days.map(day => (
|
||||
{days.map(day => (
|
||||
<TransactionDailyComponent
|
||||
transactionsDate={day}
|
||||
transactions={transactions[day]}
|
||||
|
|
Loading…
Reference in New Issue