Skip to content

Commit

Permalink
Merge pull request #266 from UB-ES-2023-A2/hotfix/sort-and-order
Browse files Browse the repository at this point in the history
[Hotfix]: Solved problems with sort and order
  • Loading branch information
guzmanalejandro authored Dec 15, 2023
2 parents 41e1b76 + 7a47088 commit 722e853
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions src/components/RecipeFilters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,37 @@ function RecipeFilters({ onClose, inValues }) {
<Form.Group>
<Form.Label>Sort By</Form.Label>
<div className="d-flex">
<Form.Select className="me-3" defaultValue={filters.sortBy}>
{sortOptions.fields.map((option) => (
<option
key={option.id}
value={option.name}
onClick={() => {
setFilters({
<Form.Select
className="me-3"
value={filters.sortBy}
onChange={(e) => {
setFilters({
...filters,
sortBy: option.name,
});
}}
>
{option.displayName}
</option>
sortBy: e.target.value,
});
}}
>
{sortOptions.fields.map((option) => (
<option
key={option.id}
value={option.name}
>
{option.displayName}
</option>
))}
</Form.Select>
<span
</Form.Select>
<span
className="fs-4 colorless-span-button"
role="button"
onClick={() => {
setFilters({
...filters,
sortAscending: !filters.sortAscending,
});
setFilters({
...filters,
sortAscending: !filters.sortAscending,
});
}}
>
>
{filters.sortAscending ? <SortUp /> : <SortDown />}
</span>
</span>
</div>
</Form.Group>
<Form.Group className="mt-4">
Expand Down

0 comments on commit 722e853

Please sign in to comment.