aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/trade_history/trade_history.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/ts/components/trade_history/trade_history.tsx')
-rw-r--r--packages/website/ts/components/trade_history/trade_history.tsx20
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/website/ts/components/trade_history/trade_history.tsx b/packages/website/ts/components/trade_history/trade_history.tsx
index 635358627..1ca9d866f 100644
--- a/packages/website/ts/components/trade_history/trade_history.tsx
+++ b/packages/website/ts/components/trade_history/trade_history.tsx
@@ -28,16 +28,16 @@ export class TradeHistory extends React.Component<TradeHistoryProps, TradeHistor
sortedFills,
};
}
- public componentWillMount() {
+ public componentWillMount(): void {
this._startPollingForFills();
}
- public componentWillUnmount() {
+ public componentWillUnmount(): void {
this._stopPollingForFills();
}
- public componentDidMount() {
+ public componentDidMount(): void {
window.scrollTo(0, 0);
}
- public render() {
+ public render(): React.ReactNode {
return (
<div className="lg-px4 md-px4 sm-px2">
<h3>Trade history</h3>
@@ -48,7 +48,7 @@ export class TradeHistory extends React.Component<TradeHistoryProps, TradeHistor
</div>
);
}
- private _renderTrades() {
+ private _renderTrades(): React.ReactNode {
const numNonCustomFills = this._numFillsWithoutCustomERC20Tokens();
if (numNonCustomFills === 0) {
return this._renderEmptyNotice();
@@ -66,14 +66,14 @@ export class TradeHistory extends React.Component<TradeHistoryProps, TradeHistor
);
});
}
- private _renderEmptyNotice() {
+ private _renderEmptyNotice(): React.ReactNode {
return (
<Paper className="mt1 p2 mx-auto center" style={{ width: '80%' }}>
No filled orders yet.
</Paper>
);
}
- private _numFillsWithoutCustomERC20Tokens() {
+ private _numFillsWithoutCustomERC20Tokens(): number {
let numNonCustomFills = 0;
const tokens = _.values(this.props.tokenByAddress);
_.each(this.state.sortedFills, fill => {
@@ -93,7 +93,7 @@ export class TradeHistory extends React.Component<TradeHistoryProps, TradeHistor
});
return numNonCustomFills;
}
- private _startPollingForFills() {
+ private _startPollingForFills(): void {
this._fillPollingIntervalId = window.setInterval(() => {
const sortedFills = this._getSortedFills();
if (!utils.deepEqual(sortedFills, this.state.sortedFills)) {
@@ -103,10 +103,10 @@ export class TradeHistory extends React.Component<TradeHistoryProps, TradeHistor
}
}, FILL_POLLING_INTERVAL);
}
- private _stopPollingForFills() {
+ private _stopPollingForFills(): void {
clearInterval(this._fillPollingIntervalId);
}
- private _getSortedFills() {
+ private _getSortedFills(): Fill[] {
const fillsByHash = tradeHistoryStorage.getUserFillsByHash(this.props.userAddress, this.props.networkId);
const fills = _.values(fillsByHash);
const sortedFills = _.sortBy(fills, [(fill: Fill) => fill.blockTimestamp * -1]);