mirror of
https://github.com/soconnor0919/beenvoice.git
synced 2026-05-08 17:48:55 -04:00
Update invoice page layout and mobile styling
- Improve responsive layout and spacing for better mobile experience - Refactor invoice skeleton loader for consistent appearance - Revise padding and spacing for better content hierarchy - Add sticky header navigation and floating action bar - Update icon sizes and button styles for better touch targets
This commit is contained in:
@@ -4,46 +4,64 @@ import { Skeleton } from "~/components/ui/skeleton";
|
||||
|
||||
export function InvoiceDetailsSkeleton() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="grid gap-6 xl:grid-cols-3">
|
||||
{/* Main Content */}
|
||||
<div className="space-y-6 xl:col-span-2">
|
||||
<div className="space-y-6 pb-24">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<Skeleton className="h-8 w-48 sm:h-9 sm:w-64" />
|
||||
<Skeleton className="mt-1 h-4 w-40 sm:w-48" />
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-8 w-20 sm:h-9 sm:w-24" />
|
||||
<Skeleton className="h-8 w-16 sm:h-9 sm:w-20" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Content */}
|
||||
<div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
||||
{/* Left Column */}
|
||||
<div className="space-y-6 lg:col-span-2">
|
||||
{/* Invoice Header Skeleton */}
|
||||
<Card className="border-0 shadow-sm">
|
||||
<Card className="shadow-sm">
|
||||
<CardContent className="p-4 sm:p-6">
|
||||
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3">
|
||||
<Skeleton className="h-6 w-48 sm:h-8" />
|
||||
<Skeleton className="h-6 w-16" />
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-start justify-between gap-6">
|
||||
<div className="min-w-0 flex-1 space-y-2">
|
||||
<div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3">
|
||||
<Skeleton className="h-6 w-40 sm:h-8 sm:w-48" />
|
||||
<Skeleton className="h-5 w-16 sm:h-6" />
|
||||
</div>
|
||||
<div className="space-y-1 sm:space-y-0">
|
||||
<Skeleton className="h-3 w-32 sm:h-4 sm:w-40" />
|
||||
<Skeleton className="h-3 w-28 sm:hidden sm:h-4 sm:w-36" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-shrink-0 text-right">
|
||||
<Skeleton className="h-3 w-20 sm:h-4" />
|
||||
<Skeleton className="mt-1 h-6 w-24 sm:h-8 sm:w-28" />
|
||||
</div>
|
||||
<Skeleton className="mt-1 h-4 w-64" />
|
||||
</div>
|
||||
<div className="text-left sm:text-right">
|
||||
<Skeleton className="h-4 w-20" />
|
||||
<Skeleton className="mt-1 h-6 w-24 sm:h-8" />
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Client & Business Information Skeleton */}
|
||||
<div className="grid gap-4 sm:gap-6 lg:grid-cols-2">
|
||||
{/* Client & Business Info */}
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
{Array.from({ length: 2 }).map((_, i) => (
|
||||
<Card key={i} className="border-0 shadow-sm">
|
||||
<Card key={i} className="shadow-sm">
|
||||
<CardHeader className="pb-3">
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-4 w-4 sm:h-5 sm:w-5" />
|
||||
<Skeleton className="h-6 w-16" />
|
||||
<Skeleton className="h-5 w-16 sm:h-6" />
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3 sm:space-y-4">
|
||||
<CardContent className="space-y-4">
|
||||
<Skeleton className="h-5 w-32 sm:h-6" />
|
||||
<div className="space-y-2 sm:space-y-3">
|
||||
<div className="space-y-3">
|
||||
{Array.from({ length: 3 }).map((_, j) => (
|
||||
<div key={j} className="flex items-center gap-2 sm:gap-3">
|
||||
<Skeleton className="h-6 w-6 rounded-lg sm:h-8 sm:w-8" />
|
||||
<Skeleton className="h-3 w-28 sm:h-4" />
|
||||
<div key={j} className="flex items-center gap-3">
|
||||
<Skeleton className="h-8 w-8 rounded-lg" />
|
||||
<Skeleton className="h-4 w-28" />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -53,130 +71,81 @@ export function InvoiceDetailsSkeleton() {
|
||||
</div>
|
||||
|
||||
{/* Invoice Items Skeleton */}
|
||||
<Card className="border-0 shadow-sm">
|
||||
<CardHeader className="pb-3">
|
||||
<Card className="shadow-sm">
|
||||
<CardHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-4 w-4 sm:h-5 sm:w-5" />
|
||||
<Skeleton className="h-5 w-28 sm:h-6" />
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent className="p-0">
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full min-w-[500px]">
|
||||
<thead>
|
||||
<tr className="border-b">
|
||||
{["Date", "Description", "Hours", "Rate", "Amount"].map(
|
||||
(header) => (
|
||||
<th key={header} className="p-2 text-left sm:p-4">
|
||||
<Skeleton className="h-3 w-16 sm:h-4" />
|
||||
</th>
|
||||
),
|
||||
)}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Array.from({ length: 3 }).map((_, i) => (
|
||||
<tr key={i} className="border-b last:border-0">
|
||||
<td className="p-2 sm:p-4">
|
||||
<Skeleton className="h-3 w-20 sm:h-4" />
|
||||
</td>
|
||||
<td className="p-2 sm:p-4">
|
||||
<Skeleton className="h-3 w-48 sm:h-4" />
|
||||
</td>
|
||||
<td className="p-2 sm:p-4">
|
||||
<Skeleton className="h-3 w-12 sm:h-4" />
|
||||
</td>
|
||||
<td className="p-2 sm:p-4">
|
||||
<Skeleton className="h-3 w-16 sm:h-4" />
|
||||
</td>
|
||||
<td className="p-2 sm:p-4">
|
||||
<Skeleton className="h-3 w-20 sm:h-4" />
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<CardContent className="space-y-4">
|
||||
{Array.from({ length: 3 }).map((_, i) => (
|
||||
<div key={i} className="space-y-3 rounded-lg border p-4">
|
||||
<div className="flex items-start justify-between gap-4">
|
||||
<div className="min-w-0 flex-1">
|
||||
<Skeleton className="mb-2 h-4 w-full sm:h-5 sm:w-3/4" />
|
||||
<div className="space-y-1 sm:space-y-0">
|
||||
<Skeleton className="h-3 w-20 sm:h-4 sm:w-24" />
|
||||
<Skeleton className="h-3 w-16 sm:hidden sm:h-4 sm:w-20" />
|
||||
<Skeleton className="h-3 w-24 sm:hidden sm:h-4 sm:w-28" />
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-shrink-0 text-right">
|
||||
<Skeleton className="h-4 w-16 sm:h-5 sm:w-20" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
{/* Totals Section Skeleton */}
|
||||
<div className="bg-muted/20 border-t p-3 sm:p-4">
|
||||
<div className="flex justify-end">
|
||||
<div className="w-full max-w-64 space-y-2">
|
||||
<div className="flex justify-between">
|
||||
<Skeleton className="h-3 w-16 sm:h-4" />
|
||||
<Skeleton className="h-3 w-20 sm:h-4" />
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<Skeleton className="h-3 w-20 sm:h-4" />
|
||||
<Skeleton className="h-3 w-20 sm:h-4" />
|
||||
</div>
|
||||
<Separator />
|
||||
<div className="flex justify-between">
|
||||
<Skeleton className="h-4 w-12 sm:h-6" />
|
||||
<Skeleton className="h-4 w-24 sm:h-6" />
|
||||
</div>
|
||||
{/* Totals */}
|
||||
<div className="bg-muted/30 rounded-lg p-4">
|
||||
<div className="space-y-3">
|
||||
<div className="flex justify-between">
|
||||
<Skeleton className="h-4 w-16" />
|
||||
<Skeleton className="h-4 w-20" />
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<Skeleton className="h-4 w-20" />
|
||||
<Skeleton className="h-4 w-16" />
|
||||
</div>
|
||||
<Separator />
|
||||
<div className="flex justify-between">
|
||||
<Skeleton className="h-5 w-12" />
|
||||
<Skeleton className="h-5 w-24" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Notes Skeleton */}
|
||||
<Card className="border-0 shadow-sm">
|
||||
<CardHeader className="pb-3">
|
||||
<Skeleton className="h-5 w-16 sm:h-6" />
|
||||
{/* Notes */}
|
||||
<Card className="shadow-sm">
|
||||
<CardHeader>
|
||||
<Skeleton className="h-6 w-16" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-2">
|
||||
<Skeleton className="h-3 w-full sm:h-4" />
|
||||
<Skeleton className="h-3 w-3/4 sm:h-4" />
|
||||
<Skeleton className="h-3 w-1/2 sm:h-4" />
|
||||
<Skeleton className="h-4 w-full" />
|
||||
<Skeleton className="h-4 w-3/4" />
|
||||
<Skeleton className="h-4 w-1/2" />
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{/* Sidebar Skeleton */}
|
||||
<div className="space-y-4 sm:space-y-6">
|
||||
{/* Actions Skeleton */}
|
||||
<Card className="border-0 shadow-sm">
|
||||
<CardHeader className="pb-3">
|
||||
<Skeleton className="h-5 w-16 sm:h-6" />
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-2 sm:space-y-3">
|
||||
{Array.from({ length: 4 }).map((_, i) => (
|
||||
<Skeleton key={i} className="h-8 w-full sm:h-10" />
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Details Skeleton */}
|
||||
<Card className="border-0 shadow-sm">
|
||||
<CardHeader className="pb-3">
|
||||
{/* Right Column - Actions */}
|
||||
<div className="space-y-6">
|
||||
<Card className="sticky top-6 shadow-sm">
|
||||
<CardHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<Skeleton className="h-4 w-4 sm:h-5 sm:w-5" />
|
||||
<Skeleton className="h-5 w-16 sm:h-6" />
|
||||
<Skeleton className="h-5 w-5" />
|
||||
<Skeleton className="h-6 w-16" />
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-2 sm:space-y-3">
|
||||
<div className="grid grid-cols-2 gap-2 sm:gap-3">
|
||||
{Array.from({ length: 6 }).map((_, i) => (
|
||||
<div key={i} className="space-y-1">
|
||||
<Skeleton className="h-3 w-16 sm:h-4" />
|
||||
<Skeleton className="h-3 w-20 sm:h-4" />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Danger Zone Skeleton */}
|
||||
<Card className="border-red-200 shadow-sm dark:border-red-800">
|
||||
<CardHeader className="pb-3">
|
||||
<Skeleton className="h-5 w-24 sm:h-6" />
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Skeleton className="h-8 w-full sm:h-10" />
|
||||
<CardContent className="space-y-3">
|
||||
{Array.from({ length: 3 }).map((_, i) => (
|
||||
<Skeleton key={i} className="h-10 w-full" />
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -57,13 +57,12 @@ export function PDFDownloadButton({
|
||||
onClick={handleDownloadPDF}
|
||||
disabled={isGenerating}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className={className}
|
||||
>
|
||||
{isGenerating ? (
|
||||
<Loader2 className="h-3 w-3 animate-spin sm:h-4 sm:w-4" />
|
||||
<Loader2 className="h-5 w-5 animate-spin" />
|
||||
) : (
|
||||
<Download className="h-3 w-3 sm:h-4 sm:w-4" />
|
||||
<Download className="h-5 w-5" />
|
||||
)}
|
||||
</Button>
|
||||
);
|
||||
@@ -74,17 +73,16 @@ export function PDFDownloadButton({
|
||||
onClick={handleDownloadPDF}
|
||||
disabled={isGenerating}
|
||||
variant={variant}
|
||||
size="default"
|
||||
className={`w-full shadow-sm ${className}`}
|
||||
className={`shadow-sm ${className ?? ""}`}
|
||||
>
|
||||
{isGenerating ? (
|
||||
<>
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||
<Loader2 className="h-5 w-5 animate-spin" />
|
||||
<span>Generating PDF...</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Download className="mr-2 h-4 w-4" />
|
||||
<Download className="h-5 w-5" />
|
||||
<span>Download PDF</span>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -10,12 +10,9 @@ import { PageHeader } from "~/components/layout/page-header";
|
||||
import { PDFDownloadButton } from "./_components/pdf-download-button";
|
||||
import { SendInvoiceButton } from "./_components/send-invoice-button";
|
||||
import { InvoiceDetailsSkeleton } from "./_components/invoice-details-skeleton";
|
||||
import { InvoiceActionsDropdown } from "./_components/invoice-actions-dropdown";
|
||||
|
||||
import {
|
||||
ArrowLeft,
|
||||
Building,
|
||||
Calendar,
|
||||
Copy,
|
||||
Edit,
|
||||
FileText,
|
||||
Mail,
|
||||
@@ -23,12 +20,6 @@ import {
|
||||
Phone,
|
||||
User,
|
||||
AlertTriangle,
|
||||
Trash2,
|
||||
DollarSign,
|
||||
Clock,
|
||||
Eye,
|
||||
Download,
|
||||
Send,
|
||||
Check,
|
||||
} from "lucide-react";
|
||||
|
||||
@@ -75,20 +66,19 @@ async function InvoiceContent({ invoiceId }: { invoiceId: string }) {
|
||||
|
||||
return (
|
||||
<div className="space-y-6 pb-24">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 className="text-foreground text-3xl font-bold">
|
||||
Invoice Details
|
||||
</h1>
|
||||
<p className="text-muted-foreground mt-1">
|
||||
View and manage invoice information
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<InvoiceActionsDropdown invoiceId={invoice.id} />
|
||||
</div>
|
||||
</div>
|
||||
<PageHeader
|
||||
title="Invoice Details"
|
||||
description="View and manage invoice information"
|
||||
variant="gradient"
|
||||
>
|
||||
<PDFDownloadButton invoiceId={invoice.id} variant="outline" />
|
||||
<Button asChild variant="default">
|
||||
<Link href={`/dashboard/invoices/${invoice.id}/edit`}>
|
||||
<Edit className="h-5 w-5" />
|
||||
<span>Edit</span>
|
||||
</Link>
|
||||
</Button>
|
||||
</PageHeader>
|
||||
|
||||
{/* Content */}
|
||||
<div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
||||
@@ -96,7 +86,7 @@ async function InvoiceContent({ invoiceId }: { invoiceId: string }) {
|
||||
<div className="space-y-6 lg:col-span-2">
|
||||
{/* Invoice Header */}
|
||||
<Card className="shadow-sm">
|
||||
<CardContent className="p-6">
|
||||
<CardContent className="p-4 sm:p-6">
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-start justify-between gap-6">
|
||||
<div className="min-w-0 flex-1 space-y-2">
|
||||
@@ -276,7 +266,7 @@ async function InvoiceContent({ invoiceId }: { invoiceId: string }) {
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
{invoice.items.map((item, index) => (
|
||||
{invoice.items.map((item) => (
|
||||
<div key={item.id} className="space-y-3 rounded-lg border p-4">
|
||||
<div className="flex items-start justify-between gap-4">
|
||||
<div className="min-w-0 flex-1">
|
||||
|
||||
Reference in New Issue
Block a user