Skip to content

Commit

Permalink
Change to select
Browse files Browse the repository at this point in the history
  • Loading branch information
chasefleming committed Jan 24, 2025
1 parent 11a638e commit ed97529
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions src/components/ProfileModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -463,23 +463,35 @@ const ProfileModal: React.FC<ProfileModalProps> = ({ isOpen, onClose }) => {
</Field>

<div className="max-w-sm">
<RadioGroup
options={flowSources.map((source) => source.name)}
value={settings?.referralSource || ''}
onChange={(value) =>
setSettings({ ...settings, referralSource: value })
}
<Field
label="How did you find Flow?"
getDescription={(option) =>
flowSources.find((source) => source.name === option)
?.description || ''
}
/>
{errors.referralSource && touched.referralSource && (
description="Let us know how you discovered Flow."
error={touched.referralSource ? errors.referralSource : undefined}
>
<select
className="w-full p-2 border rounded-md"
value={settings?.referralSource || ''}
onChange={(e) =>
setSettings({ ...settings, referralSource: e.target.value })
}
onBlur={() => setTouched({ ...touched, referralSource: true })}
>
<option value="" disabled>
Select a referral source
</option>
{flowSources.map((source) => (
<option key={source.name} value={source.name}>
{source.name}
</option>
))}
</select>
</Field>
{touched.referralSource && errors.referralSource && (
<div className="text-red-500 text-sm">{errors.referralSource}</div>
)}
</div>


{completedChallenges.length > 0 && (
<div>
<h3 className="text-lg font-bold mb-3">My Challenges</h3>
Expand Down

0 comments on commit ed97529

Please sign in to comment.