add ui tip in records for current month
This commit is contained in:
@@ -916,6 +916,7 @@ export default function DashboardPage() {
|
|||||||
transactions={data.recentTransactions}
|
transactions={data.recentTransactions}
|
||||||
hasData={hasTx}
|
hasData={hasTx}
|
||||||
rangeLabel={useTrendWindowPagination ? trendWindowLabel : undefined}
|
rangeLabel={useTrendWindowPagination ? trendWindowLabel : undefined}
|
||||||
|
userTimezone={userTimezone}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
@@ -1117,6 +1118,7 @@ export default function DashboardPage() {
|
|||||||
transactions={data.recentTransactions}
|
transactions={data.recentTransactions}
|
||||||
hasData={hasTx}
|
hasData={hasTx}
|
||||||
rangeLabel={useTrendWindowPagination ? trendWindowLabel : undefined}
|
rangeLabel={useTrendWindowPagination ? trendWindowLabel : undefined}
|
||||||
|
userTimezone={userTimezone}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
)}
|
)}
|
||||||
@@ -1278,19 +1280,29 @@ function RecentTransactionsPanel({
|
|||||||
transactions,
|
transactions,
|
||||||
hasData,
|
hasData,
|
||||||
rangeLabel,
|
rangeLabel,
|
||||||
|
userTimezone,
|
||||||
}: {
|
}: {
|
||||||
transactions: DashboardResponse["recentTransactions"];
|
transactions: DashboardResponse["recentTransactions"];
|
||||||
hasData: boolean;
|
hasData: boolean;
|
||||||
rangeLabel?: string;
|
rangeLabel?: string;
|
||||||
|
userTimezone: string;
|
||||||
}) {
|
}) {
|
||||||
const title = rangeLabel ? "Transactions in window" : "Recent transactions";
|
const title = rangeLabel ? "Transactions in window" : "Recent transactions";
|
||||||
const visibleTransactions = transactions.slice(0, 10);
|
const visibleTransactions = transactions.slice(0, 10);
|
||||||
|
const currentMonthLabel = new Intl.DateTimeFormat("en-US", {
|
||||||
|
month: "long",
|
||||||
|
year: "numeric",
|
||||||
|
timeZone: userTimezone,
|
||||||
|
}).format(new Date());
|
||||||
|
|
||||||
if (!hasData) {
|
if (!hasData) {
|
||||||
return (
|
return (
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<h2 className="font-semibold">{title}</h2>
|
<h2 className="font-semibold">{title}</h2>
|
||||||
{rangeLabel ? <div className="text-xs muted">{rangeLabel}</div> : null}
|
{rangeLabel ? <div className="text-xs muted">{rangeLabel}</div> : null}
|
||||||
|
<div className="text-xs muted">
|
||||||
|
Tip: Records defaults to This month ({currentMonthLabel}).
|
||||||
|
</div>
|
||||||
<EmptyState
|
<EmptyState
|
||||||
message="No transactions yet"
|
message="No transactions yet"
|
||||||
actionLabel="Record one"
|
actionLabel="Record one"
|
||||||
@@ -1303,6 +1315,9 @@ function RecentTransactionsPanel({
|
|||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<h2 className="font-semibold">{title}</h2>
|
<h2 className="font-semibold">{title}</h2>
|
||||||
{rangeLabel ? <div className="text-xs muted">{rangeLabel}</div> : null}
|
{rangeLabel ? <div className="text-xs muted">{rangeLabel}</div> : null}
|
||||||
|
<div className="text-xs muted">
|
||||||
|
Tip: Records defaults to This month ({currentMonthLabel}).
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Desktop table view */}
|
{/* Desktop table view */}
|
||||||
<div className="hidden sm:block border rounded-xl overflow-x-auto">
|
<div className="hidden sm:block border rounded-xl overflow-x-auto">
|
||||||
@@ -1358,7 +1373,7 @@ function RecentTransactionsPanel({
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Link to="/records" className="btn text-sm">
|
<Link to="/transactions" className="btn text-sm">
|
||||||
View more
|
View more
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user