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
17 changes: 17 additions & 0 deletions app/(public)/components/public-canvas.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use client";

import { useEffect } from "react";

/**
* Marks <html data-public> while a public page is mounted, so the canvas
* past the page edges (overscroll, the iOS rubber band) is --surface
* (globals.css). Removed again on the way into the admin.
*/
export function PublicCanvas() {
useEffect(() => {
const root = document.documentElement;
root.setAttribute("data-public", "");
return () => root.removeAttribute("data-public");
}, []);
return null;
}
24 changes: 20 additions & 4 deletions app/(public)/components/search-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,25 @@ export const SearchField = ({
query: string;
results: ReactNode;
}) => (
<div className="mt-3 flex flex-wrap items-center gap-2">
// A search form, so phone keyboards show a Search key; submitting just
// closes the keyboard (results already filter as you type).
<form
className="mt-3 flex flex-wrap items-center gap-2"
onSubmit={(submitEvent) => {
submitEvent.preventDefault();
(document.activeElement as HTMLElement | null)?.blur();
}}
role="search"
>
<div className="relative min-w-[220px] flex-1">
<Search
aria-hidden="true"
className="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-subtle"
/>
<input
aria-label={ariaLabel}
className="w-full rounded-[10px] border-2 border-line bg-surface py-2 pr-3 pl-9 text-ink"
className="w-full rounded-[10px] border-2 border-line bg-surface py-2 pr-3 pl-9 text-ink pointer-coarse:min-h-11"
enterKeyHint="search"
onChange={(changeEvent) => onQueryChange(changeEvent.target.value)}
placeholder={placeholder}
type="search"
Expand All @@ -36,12 +46,18 @@ export const SearchField = ({
<span aria-live="polite" className="text-sm text-subtle">
{results}
</span>
<Button onClick={() => onQueryChange("")} size="sm" variant="outline">
<Button
className="max-md:h-10 max-md:rounded-[16px] max-md:px-6 pointer-coarse:min-h-11"
onClick={() => onQueryChange("")}
size="sm"
type="button"
variant="outline"
>
Clear
</Button>
</>
)}
</div>
</form>
);

type RetryNoticeProps = { message: string | null; onRetry: () => void };
Expand Down
Loading
Loading