-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add range filter for reservation units
- Loading branch information
Showing
3 changed files
with
43 additions
and
22 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
apps/admin-ui/src/component/QueryParamFilters/RangeNumberFilter.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import styled from "styled-components"; | ||
import { NumberFilter } from "./NumberFilter"; | ||
|
||
const RangeContrainer = styled.div` | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
align-items: top; | ||
text-align: center; | ||
`; | ||
|
||
export function RangeNumberFilter({ | ||
label, | ||
minName, | ||
maxName, | ||
}: { | ||
label: string; | ||
minName: string; | ||
maxName: string; | ||
}) { | ||
// TODO add a proper label to it (don't use div, and hide it for screen readers) | ||
// TODO hide the actual input label (using sr-only or height 0) | ||
return ( | ||
<div> | ||
<div>{label}</div> | ||
<RangeContrainer> | ||
<NumberFilter name={minName} /> | ||
<NumberFilter name={maxName} /> | ||
</RangeContrainer> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters