redesign: YearSelector as a compact dropdown next to MonthSelector

The pill-row year switcher from the previous commit added a whole
extra row of buttons above the month pills, which read as cluttered.
Replaced it with a single dropdown button (current year + chevron)
placed to the right of MonthSelector on all three pages, matching how
a lot of finance-app date pickers separate month (frequent) from year
(occasional) navigation.
This commit is contained in:
ZProger
2026-08-16 22:15:17 +03:00
parent f3fbe4d546
commit acff447673
5 changed files with 86 additions and 32 deletions

View File

@@ -54,9 +54,11 @@ export function BudgetPage() {
<div className="space-y-5">
<AlertBanner />
<div className="space-y-2">
<div className="flex items-center gap-3">
<div className="min-w-0 flex-1">
<MonthSelector month={month} onChange={setMonth} />
</div>
<YearSelector years={years ?? [now.getFullYear()]} year={year} onChange={setYear} />
<MonthSelector month={month} onChange={setMonth} />
</div>
<Card>

View File

@@ -35,9 +35,11 @@ export function DashboardPage() {
<div className="space-y-5">
<AlertBanner excludeKeys={["risky_allocation_exceeded"]} />
<div className="space-y-2">
<div className="flex items-center gap-3">
<div className="min-w-0 flex-1">
<MonthSelector month={month} onChange={setMonth} />
</div>
<YearSelector years={years ?? [now.getFullYear()]} year={year} onChange={setYear} />
<MonthSelector month={month} onChange={setMonth} />
</div>
{isError && (

View File

@@ -63,7 +63,16 @@ export function TransactionsPage() {
return (
<div className="space-y-5">
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
<div className="space-y-2">
<div className="flex min-w-0 flex-1 items-center gap-3">
<div className="min-w-0 flex-1">
<MonthSelector
month={month}
onChange={(value) => {
setMonth(value);
setPage(1);
}}
/>
</div>
<YearSelector
years={years ?? [now.getFullYear()]}
year={year}
@@ -72,13 +81,6 @@ export function TransactionsPage() {
setPage(1);
}}
/>
<MonthSelector
month={month}
onChange={(value) => {
setMonth(value);
setPage(1);
}}
/>
</div>
<Button onClick={openCreateModal} className="w-full sm:w-auto">
<Plus size={16} />