Skip to content

Commit 374a5a3

Browse files
authored
Evaluation license form (#95)
1 parent 92d208c commit 374a5a3

3 files changed

Lines changed: 74 additions & 25 deletions

File tree

src/components/form/BookDemoForm/BookDemoForm.tsx

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ import MessageBottom from "../../alert/MessageBottom/MessageBottom";
77
import { Button } from "../../buttons/Button/Button";
88

99
type BookDemoType = {
10-
first_name: string;
11-
last_name: string;
10+
company_name: string;
1211
email: string;
13-
website_url: string;
12+
vat_id: string;
13+
country: string;
14+
street_address: string;
15+
town: string;
16+
postal_code: string;
1417
tell_us_more: string;
1518
};
1619

@@ -22,10 +25,13 @@ const BookDemoForm = ({ submit_text = "Submit" }: BookDemoFormProps) => {
2225
const [okMessage, setOkMessage] = useState(false);
2326
const [errorMessage, setErrorMessage] = useState(false);
2427
const [values, setValues] = useState<BookDemoType>({
25-
first_name: "",
26-
last_name: "",
28+
company_name: "",
2729
email: "",
28-
website_url: "",
30+
vat_id: "",
31+
country: "",
32+
street_address: "",
33+
town: "",
34+
postal_code: "",
2935
tell_us_more: "",
3036
});
3137

@@ -35,18 +41,22 @@ const BookDemoForm = ({ submit_text = "Submit" }: BookDemoFormProps) => {
3541
};
3642

3743
const handleInputChange = (
38-
event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
44+
event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>,
3945
) => {
40-
const { name, value } = event.target as HTMLInputElement | HTMLTextAreaElement;
46+
const { name, value } = event.target as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
4147
setValues({ ...values, [name]: value });
4248
};
4349

4450
const onSubmit = () => {
4551
const data = new FormData();
46-
data.append("first_name", values.first_name);
47-
data.append("last_name", values.last_name);
52+
53+
data.append("company_name", values.company_name);
4854
data.append("email", values.email);
49-
data.append("website_url", values.website_url);
55+
data.append("vat_id", values.vat_id);
56+
data.append("country", values.country);
57+
data.append("street_address", values.street_address);
58+
data.append("town", values.town);
59+
data.append("postal_code", values.postal_code);
5060
data.append(
5161
"tell_us_more",
5262
`${values.tell_us_more} \n\nform_source:${window.location.pathname + window.location.search + window.location.hash}`,
@@ -77,29 +87,44 @@ const BookDemoForm = ({ submit_text = "Submit" }: BookDemoFormProps) => {
7787
}}
7888
>
7989
<div className="double-inputs">
80-
<label htmlFor="first_name">
81-
First name
82-
<input type="text" required name="first_name" onChange={handleInputChange} />
90+
<label htmlFor="company_name">
91+
Company name
92+
<input type="text" required name="company_name" onChange={handleInputChange} />
8393
</label>
84-
<label htmlFor="last_name">
85-
Last name
86-
<input type="text" required name="last_name" onChange={handleInputChange} />
87-
</label>
88-
</div>
89-
<div className="double-inputs">
9094
<label htmlFor="email">
9195
Email
9296
<input type="email" required name="email" onChange={handleInputChange} />
9397
</label>
94-
<label htmlFor="website_url">
95-
Company website URL
96-
<input type="text" required name="website_url" onChange={handleInputChange} />
98+
</div>
99+
<div className="double-inputs">
100+
<label htmlFor="vat_id">
101+
Company VAT ID or registration number
102+
<input type="text" required name="vat_id" onChange={handleInputChange} />
103+
</label>
104+
<label htmlFor="country">
105+
Country
106+
<input type="text" required name="country" onChange={handleInputChange} />
107+
</label>
108+
</div>
109+
<div className="triple-inputs">
110+
<label htmlFor="street_address">
111+
Street address
112+
<input type="text" required name="street_address" onChange={handleInputChange} />
113+
</label>
114+
<label htmlFor="town">
115+
Town
116+
<input type="text" required name="town" onChange={handleInputChange} />
117+
</label>
118+
<label htmlFor="postal_code">
119+
Postal code
120+
<input type="text" required name="postal_code" onChange={handleInputChange} />
97121
</label>
98122
</div>
99123
<label className="single-input" htmlFor="tell_us_more">
100124
Anything else you wish to tell us?
101125
<textarea rows={7} name="tell_us_more" onChange={handleInputChange}></textarea>
102126
</label>
127+
103128
<div className="button">
104129
<Button text={submit_text} type="submit" />
105130
</div>

src/components/form/BookDemoForm/style.scss

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@
2222
}
2323
}
2424

25+
select {
26+
width: 100%;
27+
height: 38px;
28+
border: 1px solid var(--text-body-primary, #222);
29+
transition: border-color 0.5s ease-out;
30+
background-color: white;
31+
padding: 0 8px;
32+
33+
@include typography(paragraph);
34+
color: #222;
35+
&:focus {
36+
outline: 2px solid var(--surface-main-primary);
37+
border-color: var(--surface-main-primary);
38+
}
39+
}
40+
2541
label {
2642
display: flex;
2743
flex-direction: column;
@@ -50,8 +66,16 @@
5066
align-self: stretch;
5167
}
5268

69+
.triple-inputs {
70+
display: flex;
71+
align-items: flex-start;
72+
gap: 20px;
73+
align-self: stretch;
74+
}
75+
5376
@include break-down(md) {
54-
.double-inputs {
77+
.double-inputs,
78+
.triple-inputs {
5579
display: flex;
5680
flex-direction: column;
5781
align-items: flex-start;

src/pages/pricing.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const tags = [
8181
<div id="get-evaluation-license" class="sla-support-wrapper">
8282
<div id="sla-support">
8383
<div class="left">
84-
<h2>Evaluation license</h2>
84+
<h2 id="license">Request offline or evalution license</h2>
8585
<p class="sla-description">
8686
For <strong>evaluations</strong> or proof-of-concept testing, we're happy to provide
8787
a 14-day free of charge evaluation license. For convenience, please provide your company information (name, address and Tax Identification Number) in the form below.

0 commit comments

Comments
 (0)