Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit f6527ae

Browse files
committed
Merge branch 'development' of github.com:0xProject/website into development
2 parents cf8337d + 21db622 commit f6527ae

File tree

2 files changed

+48
-18
lines changed

2 files changed

+48
-18
lines changed

api/contact.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default async function handlerAsync(req: VercelRequest, res: VercelRespon
2727
role,
2828
currentTradingVolume,
2929
isApplicationLive,
30-
// productOfInterest,
30+
productOfInterest,
3131
chainOfInterest,
3232
usageDescription,
3333
timelineForIntegration,
@@ -47,7 +47,6 @@ export default async function handlerAsync(req: VercelRequest, res: VercelRespon
4747
'00N8c00000drpLI': role,
4848
'00N8c00000drpLS': currentTradingVolume,
4949
'00N8c00000drpLm': `${isApplicationLive}`,
50-
// '00N8c00000drpLw': productOfInterest,
5150
'00N8c00000drr36': chainOfInterest,
5251
'00N8c00000ds8KX': timelineForIntegration,
5352
'00N8c00000drpgB': usageDescription,
@@ -56,12 +55,17 @@ export default async function handlerAsync(req: VercelRequest, res: VercelRespon
5655
'00N8c00000drvT8': referral,
5756
};
5857

58+
const bodyInit = new URLSearchParams(payload as { [s: string]: string });
59+
for (const product of productOfInterest.split(',')) {
60+
bodyInit.append('00N8c00000drpLw', product);
61+
}
62+
5963
await fetch('https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8', {
6064
method: 'POST',
6165
headers: {
6266
'Content-Type': 'application/x-www-form-urlencoded',
6367
},
64-
body: new URLSearchParams(payload as { [s: string]: string }),
68+
body: bodyInit,
6569
});
6670

6771
return res.send('Created successfully');

ts/components/modals/modal_contact.tsx

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import { GlobalStyle } from 'ts/constants/globalStyle';
1212
import { colors } from 'ts/style/colors';
1313
import { utils } from 'ts/utils/utils';
1414

15-
// const products = ['0x Swap API'] as const;
16-
1715
const timelineForIntegrationOptions = [
1816
'I’ve already integrated!',
1917
'0-3 months',
@@ -81,7 +79,7 @@ export class ModalContact extends React.Component<Props> {
8179
isApplicationLive: false,
8280
currentTradingVolume: '0',
8381
link: '',
84-
// productOfInterest: '0x Swap API',
82+
productOfInterest: [] as string[],
8583
chainOfInterest: '',
8684
chainOfInterestOther: '',
8785
usageDescription: '',
@@ -203,7 +201,7 @@ export class ModalContact extends React.Component<Props> {
203201
<InputRow>
204202
<Input
205203
name="companyName"
206-
label="Name of Company"
204+
label="Company Name"
207205
type="text"
208206
value={this.state.companyName}
209207
required={true}
@@ -270,29 +268,55 @@ export class ModalContact extends React.Component<Props> {
270268
<InputRow>
271269
<Input
272270
name="linkToProductOrWebsite"
273-
label="Link to Product or Website"
271+
label="Company Website"
274272
type="text"
275273
value={this.state.linkToProductOrWebsite}
276274
required={false}
277275
errors={errors}
278276
onChange={this._makeOnChangeHandler('linkToProductOrWebsite')}
279277
/>
280278
</InputRow>
281-
{/* <InputRow>
282-
<GenericDropdown
283-
label="Which Products are you interested in?"
284-
name="productOfInterest"
285-
items={products}
286-
defaultValue={this.state.productOfInterest}
287-
onItemSelected={(selectedProducts) => {
288-
this.setState({ productOfInterest: selectedProducts });
279+
<InputRow>
280+
<StyledSpan>Which Products are you interested in?</StyledSpan>
281+
</InputRow>
282+
<InputRow>
283+
<CheckBoxInput
284+
label="0x API"
285+
isSelected={this.state.productOfInterest.includes('0x Swap API')}
286+
onClick={() => {
287+
if (this.state.productOfInterest.includes('0x Swap API')) {
288+
this.setState({
289+
productOfInterest: this.state.productOfInterest.filter(
290+
(item) => item !== '0x Swap API',
291+
),
292+
});
293+
} else {
294+
this.setState({ productOfInterest: [...this.state.productOfInterest, '0x Swap API'] });
295+
}
296+
}}
297+
/>
298+
<CheckBoxInput
299+
label="Data API (beta)"
300+
isSelected={this.state.productOfInterest.includes('Data API (beta)')}
301+
onClick={() => {
302+
if (this.state.productOfInterest.includes('Data API (beta)')) {
303+
this.setState({
304+
productOfInterest: this.state.productOfInterest.filter(
305+
(item) => item !== 'Data API (beta)',
306+
),
307+
});
308+
} else {
309+
this.setState({
310+
productOfInterest: [...this.state.productOfInterest, 'Data API (beta)'],
311+
});
312+
}
289313
}}
290314
/>
291-
</InputRow> */}
315+
</InputRow>
292316
<InputRow>
293317
<Input
294318
name="usageDescription"
295-
label="How do you plan to use our products?"
319+
label="How do you plan to use our products? Is there anything else you’d like to discuss?"
296320
type="textarea"
297321
value={this.state.usageDescription}
298322
required={false}
@@ -385,6 +409,7 @@ export class ModalContact extends React.Component<Props> {
385409
usageDescription,
386410
referral,
387411
isApiKeyRequired,
412+
productOfInterest,
388413
} = this.state;
389414

390415
const body = {
@@ -403,6 +428,7 @@ export class ModalContact extends React.Component<Props> {
403428
usageDescription,
404429
referral,
405430
isApiKeyRequired: `${isApiKeyRequired}`,
431+
productOfInterest: productOfInterest.join(','),
406432
};
407433

408434
await fetch('/api/contact', {

0 commit comments

Comments
 (0)