Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/PageLayout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ describe("PageLayout", () => {
<p>x</p>
</PageLayout>
);
expect(screen.getByRole("button", { name: "Add" })).toBeInTheDocument();
// Actions render in both the desktop header and the mobile strip
const buttons = screen.getAllByRole("button", { name: "Add" });
expect(buttons.length).toBeGreaterThan(0);
});

it("renders description when title is provided", () => {
Expand Down
27 changes: 17 additions & 10 deletions src/components/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,25 @@ export const PageLayout = ({
<div className="min-h-screen bg-background">
<SiteNavigationMenu />
{title !== undefined && (
<div className="hidden max-w-6xl mx-auto pt-4 pb-2 px-4 md:p-6 print:p-4">
<div className="flex items-center justify-between">
<h1 className="md:text-2xl font-bold text-foreground flex items-center gap-2">
{icon}
{title}
</h1>
{actions && <div className="print:hidden">{actions}</div>}
<>
<div className="hidden md:block max-w-6xl mx-auto pt-4 pb-2 px-4 md:p-6 print:p-4">
<div className="flex items-center justify-between">
<h1 className="md:text-2xl font-bold text-foreground flex items-center gap-2">
{icon}
{title}
</h1>
{actions && <div className="print:hidden">{actions}</div>}
</div>
{description && (
<p className="text-sm text-muted-foreground mt-1">{description}</p>
)}
</div>
{description && (
<p className="text-sm text-muted-foreground mt-1">{description}</p>
{actions && (
<div className="md:hidden flex justify-end px-4 py-2 border-b border-border print:hidden">
{actions}
</div>
)}
</div>
</>
)}
{children}
</div>
Expand Down
Loading