Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
[Issue #50]: change SortBy to USWDS component (#52)
Browse files Browse the repository at this point in the history
## Summary
Fixes #50

## Changes proposed
- switch to using USWDS `Select` component
  • Loading branch information
rylew1 authored May 28, 2024
1 parent 9b8cd17 commit 3eb5fb5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions frontend/src/components/search/SearchSortBy.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Select } from "@trussworks/react-uswds";
import { useSearchParamUpdater } from "../../hooks/useSearchParamUpdater";
import { useState } from "react";

Expand Down Expand Up @@ -43,20 +44,22 @@ const SearchSortBy: React.FC<SearchSortByProps> = ({

return (
<div id="search-sort-by">
<select
className="usa-select"
name="search-sort-by"
<label htmlFor="search-sort-by-select" className="usa-sr-only">
Sort By
</label>

<Select
id="search-sort-by-select"
name="search-sort-by"
onChange={handleChange}
value={sortBy}
aria-label="Sort By"
>
{SORT_OPTIONS.map((option) => (
<option key={option.value} value={option.value}>
{option.label}
</option>
))}
</select>
</Select>
</div>
);
};
Expand Down

0 comments on commit 3eb5fb5

Please sign in to comment.