mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 21:57:16 +01:00
Filtering via FilterBar.
This commit is contained in:
parent
da173779e0
commit
0a43ef7b1b
9 changed files with 83 additions and 26 deletions
|
|
@ -9,17 +9,14 @@ export interface DateFilterProps {
|
|||
value: string;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
offset?: number;
|
||||
className?: string;
|
||||
onChange?: (value: string) => void;
|
||||
showAllTime?: boolean;
|
||||
alignment?: 'start' | 'center' | 'end';
|
||||
}
|
||||
|
||||
export function DateFilter({
|
||||
value,
|
||||
startDate,
|
||||
endDate,
|
||||
value,
|
||||
onChange,
|
||||
showAllTime = false,
|
||||
}: DateFilterProps) {
|
||||
|
|
|
|||
|
|
@ -24,18 +24,19 @@ export function FilterBar() {
|
|||
}
|
||||
|
||||
return (
|
||||
<Row gap alignItems="center" justifyContent="space-between" paddingY="3">
|
||||
<Row alignItems="center" gap="3" wrap="wrap">
|
||||
<Row gap alignItems="center" justifyContent="space-between" padding backgroundColor="3">
|
||||
<Row alignItems="center" gap="2" wrap="wrap">
|
||||
{Object.keys(filters).map(key => {
|
||||
const filter = filters[key];
|
||||
const { name, label, operator, value } = filter;
|
||||
const paramValue = isSearchOperator(operator) ? value : formatValue(value, key);
|
||||
const paramValue = isSearchOperator(operator) ? value : formatValue(value, name);
|
||||
|
||||
return (
|
||||
<Row
|
||||
key={name}
|
||||
border
|
||||
padding
|
||||
padding="2"
|
||||
color
|
||||
backgroundColor
|
||||
borderRadius
|
||||
alignItems="center"
|
||||
|
|
@ -61,7 +62,7 @@ export function FilterBar() {
|
|||
})}
|
||||
</Row>
|
||||
<TooltipTrigger delay={0}>
|
||||
<Button variant="quiet" onPress={handleResetFilter}>
|
||||
<Button variant="wrapper" onPress={handleResetFilter} style={{ alignSelf: 'flex-start' }}>
|
||||
<Icon>
|
||||
<Close />
|
||||
</Icon>
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ export function WebsiteDateFilter({
|
|||
value={value}
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
offset={offset}
|
||||
onChange={handleChange}
|
||||
showAllTime={showAllTime}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue