Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.
TypeScript fintechinvoiceinvoice-generatorinvoice-pdfinvoice-templateinvoicesnextjsopen-sourcequotesreactreact-pdf-rendererself-hostedshadcn-uitailwindcsstypescript
refactor: update invoice page header and improve component styles (#232)
Vlad Sazonauab2169c3f0e8
diff --git a/src/app/(app)/components/invoice-page-header.tsx b/src/app/(app)/components/invoice-page-header.tsxindex d459c3a..c5900c5 100644--- a/src/app/(app)/components/invoice-page-header.tsx+++ b/src/app/(app)/components/invoice-page-header.tsx@@ -11,25 +11,22 @@ import {DialogTitle,} from "@/components/ui/dialog";import { CustomTooltip } from "@/components/ui/tooltip";-import Link from "next/link";-import { GithubIcon } from "@/components/etc/github-logo";+import { InvoicePDFDownloadLink } from "@/app/(app)/components/invoice-pdf-download-link";import { ProjectLogoDescription } from "@/app/(components)/project-logo-description";+import { GithubIcon } from "@/components/etc/github-logo";import { GITHUB_URL, VIDEO_DEMO_YOUTUBE_URL } from "@/config";import { umamiTrackEvent } from "@/lib/umami-analytics-track-event";import { cn } from "@/lib/utils";-import { AlertCircleIcon, HeartIcon, LinkIcon } from "lucide-react";+import { AlertCircleIcon, LinkIcon } from "lucide-react";import { useState } from "react";-import { InvoicePDFDownloadLink } from "@/app/(app)/components/invoice-pdf-download-link";/*** Header component for the invoice page.- *+ ** Displays the project logo, description, and action buttons including:* - Share invoice button (with conditional rendering based on shareability)* - Download PDF button with error handling- * - Support project button-* @returns The rendered invoice page header with logo, description, and action buttons*/export function InvoicePageHeader({@@ -82,34 +79,6 @@ export function InvoicePageHeader({content={"Viewing shared invoice"}/>) : null}- {/* Support project button (hidden on mobile) */}- <Button- asChild- variant="outline"- className="group mx-2 w-full border-pink-200 bg-pink-50 text-pink-700 shadow-md transition-all duration-200 hover:border-pink-300 hover:bg-pink-100 hover:text-pink-800 hover:no-underline hover:shadow-lg focus:ring-2 focus:ring-pink-500 focus:ring-offset-2 lg:mx-0 lg:inline-flex lg:w-auto"- onClick={() => {- // analytics track event- umamiTrackEvent("donate_to_project_button_clicked_header");- }}- >- <Link- href="https://dub.sh/easyinvoice-donate"- target="_blank"- rel="noopener noreferrer"- className="flex items-center gap-2"- >- Support Project- <div className="relative select-none">- <HeartIcon className="size-3 scale-110 fill-pink-500 text-pink-500 transition-all duration-200 group-hover:fill-pink-600 group-hover:text-pink-600" />- <HeartIcon- className={cn(- "size-3 animate-ping fill-pink-500 text-pink-500 duration-1000 group-hover:fill-pink-600",- "absolute inset-0 flex",- )}- />- </div>- </Link>- </Button>{/* On mobile version, we show it in different place (bottom of the page)*/}{isDesktop ? (diff --git a/src/app/(components)/header/header.client.tsx b/src/app/(components)/header/header.client.tsxindex d66e248..072531e 100644--- a/src/app/(components)/header/header.client.tsx+++ b/src/app/(components)/header/header.client.tsx@@ -40,7 +40,7 @@ export function HeaderClient({return (<header className="sticky top-4 z-50 w-full px-2 md:px-6"><div className="flex items-center justify-center">- <div className="container h-16 rounded-3xl bg-gradient-to-r from-stone-50/80 to-white px-4 shadow-sm ring-1 ring-stone-200 backdrop-blur-md md:px-6">+ <div className="container h-16 rounded-3xl bg-gradient-to-r from-white/90 to-white/95 px-4 shadow-sm ring-1 ring-stone-200 backdrop-blur-md md:px-6"><div className="flex h-full items-center justify-between gap-4">{/* App logo */}<Logodiff --git a/src/app/(components)/header/mobile-menu.tsx b/src/app/(components)/header/mobile-menu.tsxindex eea33af..a141483 100644--- a/src/app/(components)/header/mobile-menu.tsx+++ b/src/app/(components)/header/mobile-menu.tsx@@ -79,7 +79,7 @@ export function MobileMenuPanel({aria-labelledby={titleId}aria-describedby={descriptionId}className={cn(- "fixed inset-x-0 top-[84px] z-[60] mx-2 flex max-h-[calc(100dvh-4rem)] flex-col overflow-y-auto rounded-3xl border-b border-t bg-white shadow-lg md:mx-6",+ "fixed inset-x-0 top-[86px] z-[60] mx-2 flex max-h-[calc(100dvh-4rem)] flex-col overflow-y-auto rounded-3xl bg-white shadow-lg ring-1 ring-stone-200 md:mx-6","duration-200 animate-in fade-in slide-in-from-top-2",)}>diff --git a/src/app/[locale]/about/page.tsx b/src/app/[locale]/about/page.tsxindex 06e8e8b..ec9d2cd 100644--- a/src/app/[locale]/about/page.tsx+++ b/src/app/[locale]/about/page.tsx@@ -192,13 +192,19 @@ function HeroSection() {className="flex w-full items-center justify-center overflow-hidden bg-gradient-to-b from-white to-slate-50 py-10 md:py-16 xl:py-24">{/* Background decorative elements */}- <div className="absolute inset-0 overflow-hidden">- <div className="pointer-events-none absolute -right-40 -top-40 h-80 w-80 rounded-full bg-indigo-50/50 blur-3xl" />+ <div+ className="pointer-events-none absolute inset-0 overflow-hidden"+ data-info="background-decorative-elements"+ >+ <div className="absolute -right-40 -top-40 h-80 w-80 rounded-full bg-indigo-50/50 blur-3xl" /><div className="absolute bottom-0 left-1/4 h-64 w-64 rounded-full bg-emerald-50/40 blur-3xl" /></div>{/* Blur transition overlay between header and hero */}- <div className="z-5 pointer-events-none absolute left-0 right-0 top-[25px] h-32 bg-gradient-to-b from-slate-100 to-slate-50 blur-2xl" />+ <div+ data-info="blur-transition-overlay"+ className="pointer-events-none absolute left-0 right-0 top-[25px] h-32 bg-gradient-to-b from-slate-100 to-slate-50 blur-2xl"+ /><div className="container relative z-10 px-4 md:px-6"><div className="grid gap-6 md:gap-8 lg:gap-12 xl:grid-cols-2 xl:gap-6">@@ -348,9 +354,9 @@ function FeaturesSection() {</div>{/* video container */}- <div className="relative w-full max-w-[800px] px-2 pb-3 lg:px-0 lg:pb-4 xl:mx-0 xl:pb-0">+ <div className="relative w-full max-w-[800px]">{/* Mac OS Frame around the video */}- <div className="relative overflow-hidden rounded-xl border border-slate-200 bg-white shadow-lg md:rounded-2xl md:shadow-xl xl:border-b-0 xl:border-l-0 xl:border-r-0">+ <div className="relative overflow-hidden rounded-xl border border-b-0 border-l-0 border-r-0 border-slate-200 bg-white shadow-lg md:rounded-2xl md:shadow-xl">{/* Browser chrome bar */}<div className="h-8 w-full rounded-t-xl bg-gradient-to-b from-[#F3F3F3] to-[#E9E9E9] px-4 shadow-sm md:h-12 md:rounded-t-2xl"><div className="flex h-full items-center">diff --git a/src/app/changelog/page.tsx b/src/app/changelog/page.tsxindex ea1c500..aa14628 100644--- a/src/app/changelog/page.tsx+++ b/src/app/changelog/page.tsx@@ -31,6 +31,11 @@ export default async function ChangelogPage() {return (<div className="min-h-screen bg-white dark:bg-gray-900">+ {/* Blur transition overlay between header and hero */}+ <div+ data-info="blur-transition-overlay"+ className="pointer-events-none absolute left-0 right-0 top-[25px] h-24 bg-gradient-to-b from-slate-100 to-slate-50 blur-2xl"+ /><div className="relative z-0"><div className="relative mb-8 pt-16 text-center sm:mb-16"><div className="absolute bottom-0 h-full w-full bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px] [mask-image:radial-gradient(ellipse_50%_50%_at_50%_50%,#000_70%,transparent_100%)] sm:bottom-auto"></div>diff --git a/src/app/tos/page.tsx b/src/app/tos/page.tsxindex a204811..bd5d7b1 100644--- a/src/app/tos/page.tsx+++ b/src/app/tos/page.tsx@@ -1,7 +1,12 @@export default function TermsOfServicePage() {return (<div className="min-h-screen bg-white dark:bg-gray-900">- <div className="container mx-auto max-w-3xl px-4 py-12 md:px-6 md:py-16">+ {/* Blur transition overlay between header and hero */}+ <div+ data-info="blur-transition-overlay"+ className="pointer-events-none absolute left-0 right-0 top-[25px] h-24 bg-gradient-to-b from-slate-100 to-slate-50 blur-2xl"+ />+ <div className="container relative mx-auto max-w-3xl px-4 py-12 md:px-6 md:py-16"><article className="prose prose-gray max-w-none dark:prose-invert prose-headings:scroll-mt-20 prose-headings:font-semibold prose-headings:text-gray-900 prose-h1:text-3xl prose-h2:text-xl prose-p:leading-relaxed prose-p:text-gray-600 prose-strong:text-gray-900 prose-li:text-gray-600 prose-hr:border-gray-200 dark:prose-headings:text-gray-100 dark:prose-p:text-gray-300 dark:prose-strong:text-gray-100 dark:prose-li:text-gray-300 dark:prose-hr:border-gray-700"><h1>Terms of Service</h1><p>diff --git a/src/components/dev/responsive-indicator.tsx b/src/components/dev/responsive-indicator.tsxindex e9144af..46f2b60 100644--- a/src/components/dev/responsive-indicator.tsx+++ b/src/components/dev/responsive-indicator.tsx@@ -8,11 +8,10 @@ import { useEffect, useState } from "react";* (XS, SM, MD, LG, XL, 2XL) and exact pixel width. Useful for testing responsive designs.** Only renders on client side after hydration to avoid width mismatch errors.- *- * @returns {React.ReactNode | null} The responsive indicator component, or null during hydration*/export function ResponsiveIndicator() {const [width, setWidth] = useState(0);+ const [hidden, setHidden] = useState(false);useEffect(() => {const update = () => setWidth(window.innerWidth);@@ -21,7 +20,7 @@ export function ResponsiveIndicator() {return () => window.removeEventListener("resize", update);}, []);- if (width === 0) return null;+ if (width === 0 || hidden) return null;const breakpoint =width >= 1536@@ -37,7 +36,12 @@ export function ResponsiveIndicator() {: "XS";return (- <div className="fixed left-2 top-2 z-[9999] flex items-center gap-1 rounded-md bg-blue-600/90 px-2 py-1 font-mono text-xs text-white shadow-lg duration-300 animate-in fade-in slide-in-from-left-2">+ <div+ onClick={() => setHidden(true)}+ className="fixed left-2 top-2 z-[9999] flex cursor-pointer items-center gap-1 rounded-md bg-blue-600/90 px-2 py-1 font-mono text-xs text-white shadow-lg duration-300 animate-in fade-in slide-in-from-left-2"+ data-info="responsive-indicator"+ title="Click to hide"+ ><span className="font-bold">{breakpoint}</span><span className="text-blue-200">|</span><span>{width}px</span>