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