Skip to content

Commit 10fb450

Browse files
committed
use CheckboxInput component
1 parent 563f913 commit 10fb450

File tree

1 file changed

+27
-38
lines changed

1 file changed

+27
-38
lines changed

components/dashboard/src/onboarding/StepOrgInfo.tsx

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import { User } from "@gitpod/gitpod-protocol";
88
import { FC, useCallback, useMemo, useState } from "react";
9+
import { CheckboxInput } from "../components/forms/CheckboxInput";
910
import { InputField } from "../components/forms/InputField";
1011
import { SelectInputField } from "../components/forms/SelectInputField";
1112
import { TextInputField } from "../components/forms/TextInputField";
@@ -190,50 +191,38 @@ export const StepOrgInfo: FC<Props> = ({ user, onComplete }) => {
190191
<InputField label="I'm exploring Gitpod..." />
191192
<div className="mt-4 ml-2 space-y-2">
192193
{explorationReasonsOptions.map((o) => (
193-
<div key={o.value} className="flex space-x-2 justify-start items-center">
194-
<input
195-
type="checkbox"
196-
className="rounded"
197-
value={o.value}
198-
id={`explore_${o.value}`}
199-
checked={explorationReasons.includes(o.value)}
200-
onChange={(e) => {
201-
if (e.target.checked) {
202-
addExplorationReason(o.value);
203-
} else {
204-
removeExplorationReason(o.value);
205-
}
206-
}}
207-
/>
208-
<label className="text-sm dark:text-gray-400 text-gray-600" htmlFor={`explore_${o.value}`}>
209-
{o.label}
210-
</label>
211-
</div>
194+
<CheckboxInput
195+
key={o.value}
196+
value={o.value}
197+
label={o.label}
198+
checked={explorationReasons.includes(o.value)}
199+
onChange={(checked) => {
200+
if (checked) {
201+
addExplorationReason(o.value);
202+
} else {
203+
removeExplorationReason(o.value);
204+
}
205+
}}
206+
/>
212207
))}
213208
</div>
214209

215210
<InputField label="I'm signing up for Gitpod to..." />
216211
<div className="mt-4 ml-2 space-y-2">
217212
{signupGoalsOptions.map((o) => (
218-
<div key={o.value} className="flex space-x-2 justify-start items-center">
219-
<input
220-
type="checkbox"
221-
className="rounded"
222-
value={o.value}
223-
id={`goals_${o.value}`}
224-
checked={signupGoals.includes(o.value)}
225-
onChange={(e) => {
226-
if (e.target.checked) {
227-
addSignupGoal(o.value);
228-
} else {
229-
removeSignupGoal(o.value);
230-
}
231-
}}
232-
/>
233-
<label className="text-sm dark:text-gray-400 text-gray-600" htmlFor={`goals_${o.value}`}>
234-
{o.label}
235-
</label>
236-
</div>
213+
<CheckboxInput
214+
key={o.value}
215+
value={o.value}
216+
label={o.label}
217+
checked={signupGoals.includes(o.value)}
218+
onChange={(checked) => {
219+
if (checked) {
220+
addSignupGoal(o.value);
221+
} else {
222+
removeSignupGoal(o.value);
223+
}
224+
}}
225+
/>
237226
))}
238227
</div>
239228

0 commit comments

Comments
 (0)