feature: add WalletSummary in Dashboard view

This commit is contained in:
George Lima 2018-12-10 14:09:30 -03:00
parent cc5f03fc6e
commit 989a39e34a
1 changed files with 38 additions and 1 deletions

View File

@ -2,4 +2,41 @@
import React from 'react';
export const DashboardView = () => <div className='dashboard'>dashboard</div>;
import { WalletSummaryComponent } from '../components/wallet-summary';
type Props = {
getSummary: () => void,
total: number,
shielded: number,
transparent: number,
error: string | null,
isLoading: boolean,
dollarValue: number,
};
export class DashboardView extends React.Component<Props> {
componentDidMount() {
this.props.getSummary();
}
render() {
if (this.props.error) {
return this.props.error;
}
return (
<div className='dashboard'>
{this.props.isLoading ? (
'Loading'
) : (
<WalletSummaryComponent
total={this.props.total}
shielded={this.props.shielded}
transparent={this.props.transparent}
dollarValue={this.props.dollarValue}
/>
)}
</div>
);
}
}