Add dashboard filter context to remove prop drilling
This commit is contained in:
@@ -518,7 +518,11 @@ Update `JailConfig` (and the corresponding `JailConfigUpdate` patch type) to use
|
||||
|
||||
---
|
||||
|
||||
### TASK-026 — Props drilling: introduce a Dashboard filter context
|
||||
### TASK-026 — Props drilling: introduce a Dashboard filter context (done)
|
||||
|
||||
**Where fixed:** `frontend/src/pages/DashboardPage.tsx`, `frontend/src/providers/DashboardFilterProvider.tsx`, `frontend/src/components/DashboardFilterBar.tsx`, `frontend/src/components/BanTrendChart.tsx`, `frontend/src/components/BanTable.tsx`, `frontend/src/components/JailDistributionChart.tsx`
|
||||
|
||||
**Summary:** Added `DashboardFilterProvider` and `useDashboardFilters` context. `DashboardPage` now wraps its content with the provider, and `DashboardFilterBar`, `BanTrendChart`, `BanTable`, and `JailDistributionChart` consume filter state from context while still supporting explicit prop overrides.
|
||||
|
||||
**Where found:** `frontend/src/pages/DashboardPage.tsx` passes `timeRange`, `originFilter`, and `source` individually as props to `BanTrendChart`, `BanTable`, `TopCountriesPieChart`, `TopCountriesBarChart`, and `JailDistributionChart`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user