diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-12-04 04:24:37 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-12-04 04:24:37 +0800 |
commit | a192b309f339f451d647f4b9f71eac2d6684f738 (patch) | |
tree | 77ee3e5a1f32cb834fc30ce260400ce49bb301dd /packages/website/ts/pages/instant/configurator.tsx | |
parent | 4b6ac96a8db908b02a352357592dfef986e23fdc (diff) | |
download | dexon-sol-tools-a192b309f339f451d647f4b9f71eac2d6684f738.tar dexon-sol-tools-a192b309f339f451d647f4b9f71eac2d6684f738.tar.gz dexon-sol-tools-a192b309f339f451d647f4b9f71eac2d6684f738.tar.bz2 dexon-sol-tools-a192b309f339f451d647f4b9f71eac2d6684f738.tar.lz dexon-sol-tools-a192b309f339f451d647f4b9f71eac2d6684f738.tar.xz dexon-sol-tools-a192b309f339f451d647f4b9f71eac2d6684f738.tar.zst dexon-sol-tools-a192b309f339f451d647f4b9f71eac2d6684f738.zip |
feat: implement basic feeRecipient address in config generator
Diffstat (limited to 'packages/website/ts/pages/instant/configurator.tsx')
-rw-r--r-- | packages/website/ts/pages/instant/configurator.tsx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/packages/website/ts/pages/instant/configurator.tsx b/packages/website/ts/pages/instant/configurator.tsx index 0fb6d7ef8..e72f07a70 100644 --- a/packages/website/ts/pages/instant/configurator.tsx +++ b/packages/website/ts/pages/instant/configurator.tsx @@ -23,6 +23,10 @@ export class Configurator extends React.Component<ConfiguratorProps> { instantConfig: { orderSource: 'https://api.radarrelay.com/0x/v2/', availableAssetDatas: [], + affiliateInfo: { + feeRecipient: '', + feePercentage: 0.1, + }, }, }; public render(): React.ReactNode { @@ -61,7 +65,6 @@ export class Configurator extends React.Component<ConfiguratorProps> { }; private readonly _generateCodeDemoCode = (): string => { const { instantConfig } = this.state; - console.log(instantConfig.availableAssetDatas); return `<head> <script src="https://instant.0xproject.com/instant.js"></script> </head> @@ -69,18 +72,18 @@ export class Configurator extends React.Component<ConfiguratorProps> { <script> zeroExInstant.render({ liquiditySource: '${instantConfig.orderSource}',${ + !_.isUndefined(instantConfig.affiliateInfo) && instantConfig.affiliateInfo.feeRecipient + ? `\n\t\taffiliateInfo: { + feeRecipient: '${instantConfig.affiliateInfo.feeRecipient}', + feePercentage: ${instantConfig.affiliateInfo.feePercentage} + }` + : '' + }${ !_.isUndefined(instantConfig.availableAssetDatas) ? `\n\t\tavailableAssetDatas: ${this._renderAvailableAssetDatasString( instantConfig.availableAssetDatas, )}` : '' - }${ - !_.isUndefined(instantConfig.affiliateInfo) - ? `affiliateInfo: { - feeRecipient: '${instantConfig.affiliateInfo.feeRecipient}', - feePercentage: ${instantConfig.affiliateInfo.feePercentage} - }` - : '' } }, 'body'); </script> |