Skip to content

Commit

Permalink
refactor: fix a11y for timezone dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
5hraddha committed Nov 4, 2023
1 parent f3edac6 commit 25c6b84
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions components/organisms/UserSettingsPage/user-settings-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,27 +363,29 @@ const UserSettingsPage = ({ user }: userSettingsPageProps) => {
</div>

<div id="upgrade" className="flex flex-col gap-2">
<label>Time zone*</label>
<Select onValueChange={(value) => setTimezone(value)} value={timezone} required>
<SelectTrigger
selectIcon={
<div className="relative pr-4">
<RiArrowUpSLine size={16} className="absolute -top-3" />
<RiArrowDownSLine size={16} className="absolute -bottom-3" />
</div>
}
>
<SelectValue placeholder="Select time zone" />
</SelectTrigger>

<SelectContent position="item-aligned" className="bg-white">
{timezones.map((timezone, index) => (
<SelectItem key={`timezone_${index}`} value={timezone.value}>
{timezone.text}
</SelectItem>
))}
</SelectContent>
</Select>
<label className="flex flex-col w-full gap-2">
Time zone*
<Select onValueChange={(value) => setTimezone(value)} value={timezone} required>
<SelectTrigger
selectIcon={
<div className="relative pr-4">
<RiArrowUpSLine size={16} className="absolute -top-3" />
<RiArrowDownSLine size={16} className="absolute -bottom-3" />
</div>
}
>
<SelectValue placeholder="Select time zone" />
</SelectTrigger>

<SelectContent position="item-aligned" className="bg-white">
{timezones.map((timezone, index) => (
<SelectItem key={`timezone_${index}`} value={timezone.value}>
{timezone.text}
</SelectItem>
))}
</SelectContent>
</Select>
</label>
</div>
<Button
className="w-max"
Expand Down

0 comments on commit 25c6b84

Please sign in to comment.