From 21df354df63f950915a9f7a395c04b1e6db5950f Mon Sep 17 00:00:00 2001 From: Sergey Krylov Date: Sat, 27 Jun 2026 13:21:15 +0300 Subject: [PATCH] fix(frontend): align dashboard card heading hierarchy BrokerDashboardCard previously rendered , which produced an

under the

account name in BrokerAccountLayout, skipping the

level. Use level={2} so the semantic HTML is a proper

while keeping the compact "section" visual size. Also extract the byte-identical toolbar wrapper (grid + chips + date filter slot) shared by BrokerDashboardEventsCard and BrokerDashboardIncomeCard into BrokerDashboardTableToolbar to remove duplicated sx config. --- .../ui/BrokerDashboardCard.tsx | 2 +- .../ui/BrokerDashboardEventsCard.tsx | 36 +++++++------------ .../ui/BrokerDashboardIncomeCard.tsx | 36 +++++++------------ .../ui/BrokerDashboardTableToolbar.tsx | 28 +++++++++++++++ 4 files changed, 53 insertions(+), 49 deletions(-) create mode 100644 apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardTableToolbar.tsx diff --git a/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardCard.tsx b/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardCard.tsx index abd1a07..301ec6f 100644 --- a/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardCard.tsx +++ b/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardCard.tsx @@ -40,7 +40,7 @@ export function BrokerDashboardCard({ mb: 1.5, }} > - + {title} {action} diff --git a/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardEventsCard.tsx b/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardEventsCard.tsx index ed6c469..26cb870 100644 --- a/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardEventsCard.tsx +++ b/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardEventsCard.tsx @@ -8,6 +8,7 @@ import { eventStatusLabel, eventTypeLabel } from '../lib/dashboardFormatters' import { BrokerDashboardCard } from './BrokerDashboardCard' import { BrokerDashboardDateFilter } from './BrokerDashboardDateFilter' import { BrokerDashboardTableSkeleton } from './BrokerDashboardTableSkeleton' +import { BrokerDashboardTableToolbar } from './BrokerDashboardTableToolbar' const EVENT_FILTERS: Array<{ type: DashboardEventType @@ -81,30 +82,17 @@ export function BrokerDashboardEventsCard({ title="События" action={Все события} filters={ - ( + onToggleType(filter.type)} + /> + ))} > - - {EVENT_FILTERS.map((filter) => ( - onToggleType(filter.type)} - /> - ))} - - + } > {selectedTypes.length === 0 ? ( diff --git a/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardIncomeCard.tsx b/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardIncomeCard.tsx index 6c32cae..412fcc4 100644 --- a/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardIncomeCard.tsx +++ b/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardIncomeCard.tsx @@ -8,6 +8,7 @@ import { getDashboardIncomeRows, sumDashboardIncome } from '../lib/dashboardInco import { BrokerDashboardCard } from './BrokerDashboardCard' import { BrokerDashboardDateFilter } from './BrokerDashboardDateFilter' import { BrokerDashboardTableSkeleton } from './BrokerDashboardTableSkeleton' +import { BrokerDashboardTableToolbar } from './BrokerDashboardTableToolbar' const INCOME_FILTERS: Array<{ type: DashboardIncomeType @@ -73,30 +74,17 @@ export function BrokerDashboardIncomeCard({ title="Доходы" action={Все операции} filters={ - ( + onToggleType(filter.type)} + /> + ))} > - - {INCOME_FILTERS.map((filter) => ( - onToggleType(filter.type)} - /> - ))} - - + } > {selectedTypes.length === 0 ? ( diff --git a/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardTableToolbar.tsx b/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardTableToolbar.tsx new file mode 100644 index 0000000..02b5e36 --- /dev/null +++ b/apps/frontend/src/widgets/broker-dashboard/ui/BrokerDashboardTableToolbar.tsx @@ -0,0 +1,28 @@ +import { Box } from '@mui/material' +import type { ReactNode } from 'react' + +type BrokerDashboardTableToolbarProps = { + chips: ReactNode + children: ReactNode +} + +export function BrokerDashboardTableToolbar({ chips, children }: BrokerDashboardTableToolbarProps) { + return ( + + {chips} + {children} + + ) +}