* feat: announce Homarr v2 beta * chore: refine v2 beta announcement * feat: expand v2 beta guidance * chore: refine v2 beta resources * chore: simplify v2 beta modal * chore: improve v2 beta feedback links * fix: keep v2 modal above header * chore: sharpen v2 beta message * fix: clear header for v2 modal
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import type { PropsWithChildren, ReactNode } from "react";
|
|
import { useState } from "react";
|
|
import { AppShellHeader, AppShellMain } from "@mantine/core";
|
|
|
|
import { ClientShell } from "../shell";
|
|
import { V2BetaAnnouncement } from "./v2-beta-announcement";
|
|
|
|
interface V2BetaDashboardShellProps {
|
|
canExportBackup: boolean;
|
|
dismissalCookieName: string;
|
|
initiallyDismissed: boolean;
|
|
header: ReactNode;
|
|
}
|
|
|
|
export const V2BetaDashboardShell = ({
|
|
canExportBackup,
|
|
dismissalCookieName,
|
|
initiallyDismissed,
|
|
header,
|
|
children,
|
|
}: PropsWithChildren<V2BetaDashboardShellProps>) => {
|
|
const [isAnnouncementVisible, setIsAnnouncementVisible] = useState(!initiallyDismissed);
|
|
const headerHeight = isAnnouncementVisible ? 112 : 60;
|
|
|
|
return (
|
|
<ClientShell hasNavigation={false} headerHeight={headerHeight}>
|
|
<AppShellHeader maw="100vw" zIndex={201} style={{ overflowX: "hidden" }}>
|
|
{isAnnouncementVisible && (
|
|
<V2BetaAnnouncement
|
|
canExportBackup={canExportBackup}
|
|
dismissalCookieName={dismissalCookieName}
|
|
onDismiss={() => setIsAnnouncementVisible(false)}
|
|
/>
|
|
)}
|
|
{header}
|
|
</AppShellHeader>
|
|
<AppShellMain>{children}</AppShellMain>
|
|
</ClientShell>
|
|
);
|
|
};
|