diff options
author | Fred Carlsen <fred@sjelfull.no> | 2018-12-17 20:31:41 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-17 20:31:41 +0800 |
commit | 88240f6401c0a741ae66e63b77c1abe9d22a9037 (patch) | |
tree | 794cc43bd5fa1d1225211e3ca01b445201d9c36b /packages/website | |
parent | 7065a098e3b905784627126e4f64caa85b0980df (diff) | |
download | dexon-sol-tools-88240f6401c0a741ae66e63b77c1abe9d22a9037.tar.gz dexon-sol-tools-88240f6401c0a741ae66e63b77c1abe9d22a9037.tar.zst dexon-sol-tools-88240f6401c0a741ae66e63b77c1abe9d22a9037.zip |
Fix liquidity source change
Diffstat (limited to 'packages/website')
-rw-r--r-- | packages/website/ts/@next/pages/instant/config_generator.tsx | 5 | ||||
-rw-r--r-- | packages/website/ts/@next/pages/instant/select.tsx | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/packages/website/ts/@next/pages/instant/config_generator.tsx b/packages/website/ts/@next/pages/instant/config_generator.tsx index 8857e4fea..4f837d7fa 100644 --- a/packages/website/ts/@next/pages/instant/config_generator.tsx +++ b/packages/website/ts/@next/pages/instant/config_generator.tsx @@ -64,7 +64,7 @@ export class ConfigGenerator extends React.Component<ConfigGeneratorProps, Confi return ( <Container minWidth="350px"> <ConfigGeneratorSection title="Liquidity Source"> - <Select id="" value={value.orderSource} items={this._generateItems()} /> + <Select id="" value={value.orderSource} items={this._generateItems()} onChange={this._handleSRASelection.bind(this)} /> </ConfigGeneratorSection> <ConfigGeneratorSection {...this._getTokenSelectorProps()}> {this._renderTokenMultiSelectOrSpinner()} @@ -122,7 +122,8 @@ export class ConfigGenerator extends React.Component<ConfigGeneratorProps, Confi private readonly _handleAffiliatePercentageLearnMoreClick = (): void => { window.open(`${WebsitePaths.Wiki}#Learn-About-Affiliate-Fees`, '_blank'); }; - private readonly _handleSRASelection = (sraEndpoint: string) => { + private readonly _handleSRASelection = (event: Event) => { + const sraEndpoint = event.target.value; const newConfig: ZeroExInstantBaseConfig = { ...this.props.value, orderSource: sraEndpoint, diff --git a/packages/website/ts/@next/pages/instant/select.tsx b/packages/website/ts/@next/pages/instant/select.tsx index ae2a07b3d..422818f9f 100644 --- a/packages/website/ts/@next/pages/instant/select.tsx +++ b/packages/website/ts/@next/pages/instant/select.tsx @@ -12,12 +12,13 @@ interface SelectProps { id: string; items: SelectItemConfig[]; emptyText?: string; + onChange?: () => void; } -export const Select: React.FunctionComponent<SelectProps> = ({ value, id, items, emptyText }) => { +export const Select: React.FunctionComponent<SelectProps> = ({ value, id, items, emptyText, onChange }) => { return ( <Container> - <StyledSelect id={id}> + <StyledSelect id={id} onChange={onChange}> <option value="">{emptyText}</option> {items.map((item, index) => <option key={`${id}-item-${index}`} value={item.value} selected={item.value === value} onClick={item.onClick}>{item.label}</option>)} </StyledSelect> |