diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-06-06 14:34:20 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-06-06 16:33:35 +0800 |
commit | 1677817d9fb31d47080705fc4336555f74cbe687 (patch) | |
tree | a827aaf67dcd898e38cec74b8ef477b8ea072276 /packages/website/ts/components/generate_order | |
parent | 03854baf53c5767db7130b8f6d7e91aae015e867 (diff) | |
download | dexon-sol-tools-1677817d9fb31d47080705fc4336555f74cbe687.tar.gz dexon-sol-tools-1677817d9fb31d47080705fc4336555f74cbe687.tar.zst dexon-sol-tools-1677817d9fb31d47080705fc4336555f74cbe687.zip |
Update GenerateOrderForm and FillOrder components
Diffstat (limited to 'packages/website/ts/components/generate_order')
-rw-r--r-- | packages/website/ts/components/generate_order/generate_order_form.tsx | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/packages/website/ts/components/generate_order/generate_order_form.tsx b/packages/website/ts/components/generate_order/generate_order_form.tsx index 5f968a5e4..e786719b0 100644 --- a/packages/website/ts/components/generate_order/generate_order_form.tsx +++ b/packages/website/ts/components/generate_order/generate_order_form.tsx @@ -47,6 +47,8 @@ interface GenerateOrderFormProps { sideToAssetToken: SideToAssetToken; tokenByAddress: TokenByAddress; lastForceTokenStateRefetch: number; + isFullWidth?: boolean; + shouldRenderHeader?: boolean; } interface GenerateOrderFormState { @@ -56,6 +58,10 @@ interface GenerateOrderFormState { } export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, GenerateOrderFormState> { + public static defaultProps: Partial<GenerateOrderFormProps> = { + isFullWidth: false, + shouldRenderHeader: true, + }; constructor(props: GenerateOrderFormProps) { super(props); this.state = { @@ -80,10 +86,15 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G const exchangeContractIfExists = this.props.blockchain.getExchangeContractAddressIfExists(); const initialTakerAddress = this.props.orderTakerAddress === constants.NULL_ADDRESS ? '' : this.props.orderTakerAddress; + const rootClassName = this.props.isFullWidth ? 'clearfix mb2' : 'clearfix mb2 lg-px4 md-px4 sm-px2'; return ( - <div className="clearfix mb2 lg-px4 md-px4 sm-px2"> - <h3>Generate an order</h3> - <Divider /> + <div className={rootClassName}> + {this.props.shouldRenderHeader && ( + <div> + <h3>Generate an order</h3> + <Divider /> + </div> + )} <div className="mx-auto" style={{ maxWidth: 580 }}> <div className="pt3"> <div className="mx-auto clearfix"> |