Make scrollability a prop on TradeHistory

This commit is contained in:
Brandon Millman
2018-06-06 00:19:41 -07:00
parent ab4d2faea3
commit b5dc72b126
2 changed files with 10 additions and 3 deletions

View File

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

View File

@@ -15,6 +15,7 @@ interface TradeHistoryProps {
networkId: number;
isFullWidth?: boolean;
shouldRenderHeader?: boolean;
isScrollable?: boolean;
}
interface TradeHistoryState {
@@ -25,6 +26,7 @@ export class TradeHistory extends React.Component<TradeHistoryProps, TradeHistor
public static defaultProps: Partial<TradeHistoryProps> = {
isFullWidth: false,
shouldRenderHeader: true,
isScrollable: true,
};
private _fillPollingIntervalId: number;
public constructor(props: TradeHistoryProps) {
@@ -53,9 +55,13 @@ export class TradeHistory extends React.Component<TradeHistoryProps, TradeHistor
<Divider />
</div>
)}
<div className="pt2" style={{ height: 608, overflow: 'scroll' }}>
{this._renderTrades()}
</div>
{this.props.isScrollable ? (
<div className="pt2" style={{ height: 608, overflow: 'scroll' }}>
{this._renderTrades()}
</div>
) : (
this._renderTrades()
)}
</div>
);
}