Skip to content

Commit e6694bd

Browse files
committed
use CheckboxInput component
1 parent cd266d6 commit e6694bd

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";
@@ -186,50 +187,38 @@ export const StepOrgInfo: FC<Props> = ({ user, onComplete }) => {
186187
<InputField label="I'm exploring Gitpod..." />
187188
<div className="mt-4 ml-2 space-y-2">
188189
{explorationReasonsOptions.map((o) => (
189-
<div key={o.value} className="flex space-x-2 justify-start items-center">
190-
<input
191-
type="checkbox"
192-
className="rounded"
193-
value={o.value}
194-
id={`explore_${o.value}`}
195-
checked={explorationReasons.includes(o.value)}
196-
onChange={(e) => {
197-
if (e.target.checked) {
198-
addExplorationReason(o.value);
199-
} else {
200-
removeExplorationReason(o.value);
201-
}
202-
}}
203-
/>
204-
<label className="text-sm dark:text-gray-400 text-gray-600" htmlFor={`explore_${o.value}`}>
205-
{o.label}
206-
</label>
207-
</div>
190+
<CheckboxInput
191+
key={o.value}
192+
value={o.value}
193+
label={o.label}
194+
checked={explorationReasons.includes(o.value)}
195+
onChange={(checked) => {
196+
if (checked) {
197+
addExplorationReason(o.value);
198+
} else {
199+
removeExplorationReason(o.value);
200+
}
201+
}}
202+
/>
208203
))}
209204
</div>
210205

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

0 commit comments

Comments
 (0)