Update TradeHistory component

This commit is contained in:
Brandon Millman
2018-06-05 23:10:26 -07:00
parent a0e8f410d1
commit 61dc253de1
2 changed files with 16 additions and 3 deletions

View File

@@ -439,6 +439,8 @@ export class Portal extends React.Component<PortalProps, PortalState> {
tokenByAddress={this.props.tokenByAddress}
userAddress={this.props.userAddress}
networkId={this.props.networkId}
isFullWidth={true}
shouldRenderHeader={false}
/>
);
}

View File

@@ -13,6 +13,8 @@ interface TradeHistoryProps {
tokenByAddress: TokenByAddress;
userAddress: string;
networkId: number;
isFullWidth?: boolean;
shouldRenderHeader?: boolean;
}
interface TradeHistoryState {
@@ -20,6 +22,10 @@ interface TradeHistoryState {
}
export class TradeHistory extends React.Component<TradeHistoryProps, TradeHistoryState> {
public static defaultProps: Partial<TradeHistoryProps> = {
isFullWidth: false,
shouldRenderHeader: true,
};
private _fillPollingIntervalId: number;
public constructor(props: TradeHistoryProps) {
super(props);
@@ -38,10 +44,15 @@ export class TradeHistory extends React.Component<TradeHistoryProps, TradeHistor
window.scrollTo(0, 0);
}
public render(): React.ReactNode {
const rootClassName = !this.props.isFullWidth ? 'lg-px4 md-px4 sm-px2' : undefined;
return (
<div className="lg-px4 md-px4 sm-px2">
<h3>Trade history</h3>
<Divider />
<div className={rootClassName}>
{this.props.shouldRenderHeader && (
<div>
<h3>Trade history</h3>
<Divider />
</div>
)}
<div className="pt2" style={{ height: 608, overflow: 'scroll' }}>
{this._renderTrades()}
</div>