aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/website/ts/@next/pages/instant/config_generator.tsx5
-rw-r--r--packages/website/ts/@next/pages/instant/select.tsx5
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>