Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to a select box #1111

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading