diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-06-06 14:10:26 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-06-06 16:33:35 +0800 |
commit | 61dc253de1b4da6606bc0ddea463e78447598798 (patch) | |
tree | ce127f7896a57a71a3419fe344bbc4a9bc2fb28f /packages | |
parent | a0e8f410d196cff4c5e25c05f085c1818496168b (diff) | |
download | dexon-sol-tools-61dc253de1b4da6606bc0ddea463e78447598798.tar.gz dexon-sol-tools-61dc253de1b4da6606bc0ddea463e78447598798.tar.zst dexon-sol-tools-61dc253de1b4da6606bc0ddea463e78447598798.zip |
Update TradeHistory component
Diffstat (limited to 'packages')
-rw-r--r-- | packages/website/ts/components/portal/portal.tsx | 2 | ||||
-rw-r--r-- | packages/website/ts/components/trade_history/trade_history.tsx | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/packages/website/ts/components/portal/portal.tsx b/packages/website/ts/components/portal/portal.tsx index 28fcf10df..fb818056d 100644 --- a/packages/website/ts/components/portal/portal.tsx +++ b/packages/website/ts/components/portal/portal.tsx @@ -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} /> ); } diff --git a/packages/website/ts/components/trade_history/trade_history.tsx b/packages/website/ts/components/trade_history/trade_history.tsx index 1ca9d866f..1c47d4ecd 100644 --- a/packages/website/ts/components/trade_history/trade_history.tsx +++ b/packages/website/ts/components/trade_history/trade_history.tsx @@ -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> |