feat: enhance TransactionsPage with total count and amount display; update CategoryCard and ParentCategoryRow to link to transaction filters by category; implement localStorage for transaction period preference
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m57s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m57s
This commit is contained in:
@@ -243,6 +243,13 @@ export default function TransactionsPage() {
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 py-3 px-6">
|
||||
<CardTitle className="text-base font-semibold">
|
||||
Statistiques
|
||||
{!isStatsExpanded && (
|
||||
<span className="ml-3 text-sm font-normal text-muted-foreground">
|
||||
{displayTotalCount} opération
|
||||
{displayTotalCount > 1 ? "s" : ""} •{" "}
|
||||
{formatCurrency(totalAmount)}
|
||||
</span>
|
||||
)}
|
||||
</CardTitle>
|
||||
<CollapsibleTrigger asChild>
|
||||
<Button variant="ghost" size="sm" className="h-8">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { CategoryIcon } from "@/components/ui/category-icon";
|
||||
@@ -37,7 +38,13 @@ export function CategoryCard({
|
||||
size={isMobile ? 10 : 12}
|
||||
/>
|
||||
</div>
|
||||
<span className="text-xs md:text-sm truncate">{category.name}</span>
|
||||
<Link
|
||||
href={`/transactions?categoryIds=${category.id}`}
|
||||
className="text-xs md:text-sm truncate hover:underline"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
{category.name}
|
||||
</Link>
|
||||
{!isMobile && (
|
||||
<span className="text-xs md:text-sm text-muted-foreground shrink-0">
|
||||
{stats.count} opération{stats.count > 1 ? "s" : ""} •{" "}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
@@ -73,9 +74,13 @@ export function ParentCategoryRow({
|
||||
size={isMobile ? 10 : 14}
|
||||
/>
|
||||
</div>
|
||||
<span className="font-medium text-xs md:text-sm truncate">
|
||||
<Link
|
||||
href={`/transactions?categoryIds=${parent.id}`}
|
||||
className="font-medium text-xs md:text-sm truncate hover:underline"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
{parent.name}
|
||||
</span>
|
||||
</Link>
|
||||
{!isMobile && (
|
||||
<span className="text-xs md:text-sm text-muted-foreground shrink-0">
|
||||
{children.length} • {stats.count} opération
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
useTransactions,
|
||||
useDuplicateIds,
|
||||
} from "@/lib/hooks";
|
||||
import { useLocalStorage } from "@/hooks/use-local-storage";
|
||||
import type { TransactionsPaginatedParams } from "@/services/banking.service";
|
||||
import type { Category } from "@/lib/types";
|
||||
|
||||
@@ -30,7 +31,7 @@ export function useTransactionsPage() {
|
||||
"all",
|
||||
]);
|
||||
const [showReconciled, setShowReconciled] = useState<string>("all");
|
||||
const [period, setPeriod] = useState<Period>("3months");
|
||||
const [period, setPeriod] = useLocalStorage<Period>("transactions-period", "3months");
|
||||
const [customStartDate, setCustomStartDate] = useState<Date | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user