diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-12-06 15:33:04 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-12-06 15:33:04 +0800 |
commit | 179f093c2609b4d453db7ed2eeed780d9c89e941 (patch) | |
tree | 651f0065f31d07e8bfd6a3772ad5e3ca7916038d /packages/website | |
parent | 6438241144af86caf4fdc8c4a5ce080f1ed2bbff (diff) | |
download | dexon-sol-tools-179f093c2609b4d453db7ed2eeed780d9c89e941.tar dexon-sol-tools-179f093c2609b4d453db7ed2eeed780d9c89e941.tar.gz dexon-sol-tools-179f093c2609b4d453db7ed2eeed780d9c89e941.tar.bz2 dexon-sol-tools-179f093c2609b4d453db7ed2eeed780d9c89e941.tar.lz dexon-sol-tools-179f093c2609b4d453db7ed2eeed780d9c89e941.tar.xz dexon-sol-tools-179f093c2609b4d453db7ed2eeed780d9c89e941.tar.zst dexon-sol-tools-179f093c2609b4d453db7ed2eeed780d9c89e941.zip |
feat: disable slider when no affiliate info
Diffstat (limited to 'packages/website')
-rw-r--r-- | packages/website/ts/pages/instant/config_generator.tsx | 5 | ||||
-rw-r--r-- | packages/website/ts/pages/instant/fee_percentage_slider.tsx | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/packages/website/ts/pages/instant/config_generator.tsx b/packages/website/ts/pages/instant/config_generator.tsx index fe70ef04c..fbeeeaeaf 100644 --- a/packages/website/ts/pages/instant/config_generator.tsx +++ b/packages/website/ts/pages/instant/config_generator.tsx @@ -79,6 +79,11 @@ export class ConfigGenerator extends React.Component<ConfigGeneratorProps, Confi <FeePercentageSlider value={value.affiliateInfo.feePercentage} onChange={this._handleAffiliatePercentageChange} + isDisabled={ + _.isUndefined(value.affiliateInfo) || + _.isUndefined(value.affiliateInfo.feeRecipient) || + _.isEmpty(value.affiliateInfo.feeRecipient) + } /> </ConfigGeneratorSection> </Container> diff --git a/packages/website/ts/pages/instant/fee_percentage_slider.tsx b/packages/website/ts/pages/instant/fee_percentage_slider.tsx index 4c92883cb..d76cee58f 100644 --- a/packages/website/ts/pages/instant/fee_percentage_slider.tsx +++ b/packages/website/ts/pages/instant/fee_percentage_slider.tsx @@ -31,10 +31,14 @@ injectGlobal` margin-left: -60%; } } + .rc-slider-disabled { + background-color: inherit !important; + } `; export interface FeePercentageSliderProps { value: number; + isDisabled: boolean; onChange: (value: number) => void; } @@ -42,6 +46,7 @@ export class FeePercentageSlider extends React.Component<FeePercentageSliderProp public render(): React.ReactNode { return ( <SliderWithTooltip + disabled={this.props.isDisabled} min={0} max={0.05} step={0.0025} |