Skip to content

Commit

Permalink
feat: alerts dialog all filter
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Dec 8, 2023
1 parent 7bb39ff commit 1bd5309
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
7 changes: 7 additions & 0 deletions .changeset/witty-peaches-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'hostd': minor
'renterd': minor
'@siafoundation/design-system': minor
---

The alerts dialog now has an "all" filter.
5 changes: 5 additions & 0 deletions apps/renterd/dialogs/AlertsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ const dataFields: Record<
params: {
key: value,
},
config: {
swr: {
revalidateOnFocus: false,
},
},
})
return (
<>
Expand Down
26 changes: 10 additions & 16 deletions libs/design-system/src/app/AlertsDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,39 +98,33 @@ export function AlertsDialog({
Alerts {alerts.data ? `(${alerts.data.length})` : ''}
</Heading>
<div className="flex gap-1">
<Button
variant={filter === undefined ? 'accent' : 'gray'}
onClick={() => setFilter(undefined)}
>
all
</Button>
<Button
variant={filter === 'info' ? 'accent' : 'gray'}
onClick={() =>
filter === 'info' ? setFilter(undefined) : setFilter('info')
}
onClick={() => setFilter('info')}
>
info
</Button>
<Button
variant={filter === 'warning' ? 'accent' : 'gray'}
onClick={() =>
filter === 'warning'
? setFilter(undefined)
: setFilter('warning')
}
onClick={() => setFilter('warning')}
>
warning
</Button>
<Button
variant={filter === 'error' ? 'accent' : 'gray'}
onClick={() =>
filter === 'error' ? setFilter(undefined) : setFilter('error')
}
onClick={() => setFilter('error')}
>
error
</Button>
<Button
variant={filter === 'critical' ? 'accent' : 'gray'}
onClick={() =>
filter === 'critical'
? setFilter(undefined)
: setFilter('critical')
}
onClick={() => setFilter('critical')}
>
critical
</Button>
Expand Down

0 comments on commit 1bd5309

Please sign in to comment.