App: wyswietlanie na iOS Safari — viewport-fit=cover, plywajacy tytul zamiast gornej belki, dolny pasek tylko z opcjami i do krawedzi ekranu
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<!-- bez viewport-fit=cover: na Androidzie (Firefox z paskiem adresu na dole) cover
|
||||
rozlewa layout viewport za UI przeglądarki i chowa fixed bottom-0 za paskiem -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<!-- viewport-fit=cover + env(safe-area-inset-*): treść (akcje paska, drawer, toast)
|
||||
wypełnia pola safe-area (notch iOS); bez cover dolny pasek kończy się nad
|
||||
półprzezroczystym UI Safari i treść prześwituje za górną/dolną belką -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||
<meta name="theme-color" content="#141210" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<link rel="icon" href="/icons/icon-192.png" type="image/png" />
|
||||
|
||||
@@ -257,7 +257,7 @@ export default function Layout() {
|
||||
className="absolute inset-0 animate-in fade-in-0 bg-black/60 duration-150"
|
||||
onClick={() => setDrawerOpen(false)}
|
||||
/>
|
||||
<aside className="absolute left-0 top-0 flex h-full w-72 animate-in slide-in-from-left flex-col border-r border-line bg-card duration-200">
|
||||
<aside className="absolute left-0 top-0 flex h-full w-72 animate-in slide-in-from-left flex-col border-r border-line bg-card pb-[env(safe-area-inset-bottom)] duration-200">
|
||||
<div className="flex items-center justify-between px-4 py-4">
|
||||
<div className="flex items-center gap-2.5">
|
||||
<Brandmark size={26} />
|
||||
|
||||
@@ -50,7 +50,7 @@ export function ToastProvider({ children }: { children: ReactNode }) {
|
||||
{children}
|
||||
<div
|
||||
aria-live="polite"
|
||||
className="pointer-events-none fixed bottom-[calc(4.25rem+env(safe-area-inset-bottom))] left-4 right-4 z-[70] flex flex-col gap-2 sm:left-auto sm:right-4 sm:w-80 md:bottom-4"
|
||||
className="pointer-events-none fixed bottom-[calc(4.25rem+max(env(safe-area-inset-bottom),0.75rem))] left-4 right-4 z-[70] flex flex-col gap-2 sm:left-auto sm:right-4 sm:w-80 md:bottom-4"
|
||||
>
|
||||
{toasts.map((t) => {
|
||||
const { icon: Icon, cls } = TOAST_STYLES[t.kind];
|
||||
|
||||
@@ -114,43 +114,59 @@ export function Topbar({ onMenuOpen }: { onMenuOpen?: () => void }) {
|
||||
if (config?.search) presentGroups.add('search');
|
||||
const menuOpen = openGroup != null && presentGroups.has(openGroup);
|
||||
|
||||
// Telefon: dolny pasek tylko gdy strona ma w nim coś do pokazania (bez
|
||||
// „Wstecz”/hamburgera — one żyją w pływającym pasku tytułu u góry).
|
||||
const mobileBarEmpty =
|
||||
!hasFilters &&
|
||||
(config?.groups?.length ?? 0) === 0 &&
|
||||
actions.length === 0 &&
|
||||
!config?.search &&
|
||||
config?.navWidget == null;
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-30 border-b border-line bg-bg">
|
||||
<div className="mx-auto flex max-w-5xl items-center justify-between gap-3 px-4 py-2.5 md:px-8 md:py-3">
|
||||
{onMenuOpen && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onMenuOpen}
|
||||
aria-label="Otwórz menu"
|
||||
className="grid h-[34px] w-[34px] flex-none cursor-pointer place-items-center rounded-[10px] border border-line bg-card text-dim shadow-card transition-colors hover:text-ink md:hidden"
|
||||
>
|
||||
<Menu className="h-4 w-4" />
|
||||
</button>
|
||||
)}
|
||||
<h1 className="min-w-0 flex-1 truncate text-[1.15rem] font-bold tracking-[-0.01em] md:flex-none">
|
||||
{config?.title}
|
||||
</h1>
|
||||
{/* akcje kontekstowe: md+ inline w nagłówku; telefon = pasek na dole ekranu */}
|
||||
<div
|
||||
className={cn(
|
||||
'flex shrink-0 items-center gap-2 md:flex-wrap md:justify-end',
|
||||
'max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:z-40 max-md:justify-center max-md:gap-2 max-md:border-t max-md:border-line max-md:bg-card max-md:px-3 max-md:pt-2 max-md:pb-[max(0.5rem,env(safe-area-inset-bottom))]',
|
||||
)}
|
||||
style={vvBottom > 0 ? { bottom: vvBottom } : undefined}
|
||||
>
|
||||
{/* nawigacja (np. Kalendarz) zawsze widoczna, nie jest grupą */}
|
||||
{config?.navWidget}
|
||||
{/* telefon: „<” = wróć do strony-rodzica zadeklarowanej przez podstronę */}
|
||||
<header className="sticky top-0 z-30 border-b border-line bg-bg max-md:contents">
|
||||
{/* telefon: header rozbity (contents) — tytuł jako pływający pasek z shadow,
|
||||
bez belki na całą szerokość; akcje i tak żyją w dolnym pasku */}
|
||||
<div className="mx-auto max-w-5xl px-4 max-md:sticky max-md:top-[max(0.5rem,env(safe-area-inset-top))] max-md:z-20 md:px-8">
|
||||
<div className="flex items-center justify-between gap-3 py-2.5 md:py-3">
|
||||
<h1 className="min-w-0 flex-1 truncate rounded-2xl text-[1.15rem] font-bold tracking-[-0.01em] max-md:-mb-[7px] max-md:-mt-[7px] max-md:border max-md:border-line/60 max-md:bg-bg/72 max-md:py-2.5 max-md:shadow-[0_8px_24px_-10px_rgba(0,0,0,0.55)] max-md:backdrop-blur-md md:flex-none">
|
||||
{config?.title}
|
||||
</h1>
|
||||
{/* telefon: „<” wracający do strony-rodzica (po prawej, przy hamburgerze) */}
|
||||
{config?.back && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => (config.onBack ? config.onBack() : navigate(config.back!))}
|
||||
aria-label="Wstecz"
|
||||
className="grid h-[34px] w-[34px] flex-none cursor-pointer place-items-center rounded-[10px] border border-line bg-card text-dim shadow-card transition-colors hover:text-ink md:hidden"
|
||||
className="-ml-1 grid h-[34px] w-[34px] flex-none cursor-pointer place-items-center rounded-[10px] text-dim transition-colors hover:text-ink md:hidden"
|
||||
>
|
||||
<ChevronLeft className="h-4 w-4" />
|
||||
</button>
|
||||
)}
|
||||
{/* telefon: hamburger po prawej pływającego paska; md+: sidebar ma własny */}
|
||||
{onMenuOpen && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onMenuOpen}
|
||||
aria-label="Otwórz menu"
|
||||
className="grid h-[34px] w-[34px] flex-none cursor-pointer place-items-center rounded-[10px] border border-line bg-card text-dim shadow-card transition-colors hover:text-ink md:hidden"
|
||||
>
|
||||
<Menu className="h-4 w-4" />
|
||||
</button>
|
||||
)}
|
||||
{/* akcje kontekstowe: md+ inline w nagłówku; telefon = pasek na dole ekranu
|
||||
(renderowany tylko gdy strona ma w nim jakąś opcję) */}
|
||||
<div
|
||||
className={cn(
|
||||
'flex shrink-0 items-center gap-2 md:flex-wrap md:justify-end',
|
||||
'max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:z-40 max-md:justify-center max-md:gap-2 max-md:border-t max-md:border-line max-md:bg-card max-md:px-3 max-md:pt-2 max-md:pb-[max(0.75rem,calc(env(safe-area-inset-bottom)+0.5rem))]',
|
||||
'max-md:shadow-[0_-8px_24px_-12px_rgba(0,0,0,0.5)]',
|
||||
mobileBarEmpty && 'max-md:hidden',
|
||||
)}
|
||||
style={vvBottom > 0 ? { bottom: vvBottom } : undefined}
|
||||
>
|
||||
{/* nawigacja (np. Kalendarz) zawsze widoczna, nie jest grupą */}
|
||||
{config?.navWidget}
|
||||
{hasFilters && (
|
||||
<GroupButton
|
||||
icon={Filter}
|
||||
@@ -237,6 +253,7 @@ export function Topbar({ onMenuOpen }: { onMenuOpen?: () => void }) {
|
||||
<X className="h-4 w-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user