feat: disable slider when no affiliate info
This commit is contained in:
parent
6438241144
commit
179f093c26
@ -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>
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user