|
|
@@ -30,29 +30,28 @@ type Tab = ComponentProps<typeof MainNavTabs>["tabs"][number] & {
|
|
|
children: ReactNode;
|
|
|
};
|
|
|
|
|
|
-type Props = AppBodyProps & {
|
|
|
+type AppShellRootProps = {
|
|
|
enableAccessibilityReporting: boolean;
|
|
|
amplitudeApiKey?: string | undefined;
|
|
|
googleAnalyticsId?: string | undefined;
|
|
|
providers?: ComponentProps<typeof ComposeProviders>["providers"] | undefined;
|
|
|
+ children: ReactNode;
|
|
|
};
|
|
|
|
|
|
-export const AppShell = ({
|
|
|
+export const AppShellRoot = ({
|
|
|
enableAccessibilityReporting,
|
|
|
amplitudeApiKey,
|
|
|
googleAnalyticsId,
|
|
|
providers,
|
|
|
- ...props
|
|
|
-}: Props) => (
|
|
|
+ children,
|
|
|
+}: AppShellRootProps) => (
|
|
|
<RootProviders providers={providers}>
|
|
|
<HtmlWithLang
|
|
|
// See https://github.com/pacocoursey/next-themes?tab=readme-ov-file#with-app
|
|
|
suppressHydrationWarning
|
|
|
className={clsx(sans.className, styles.html)}
|
|
|
>
|
|
|
- <body className={styles.body}>
|
|
|
- <AppBody {...props} />
|
|
|
- </body>
|
|
|
+ <body className={styles.body}>{children}</body>
|
|
|
{googleAnalyticsId && <GoogleAnalytics gaId={googleAnalyticsId} />}
|
|
|
{amplitudeApiKey && <Amplitude apiKey={amplitudeApiKey} />}
|
|
|
{enableAccessibilityReporting && <ReportAccessibility />}
|
|
|
@@ -60,6 +59,23 @@ export const AppShell = ({
|
|
|
</RootProviders>
|
|
|
);
|
|
|
|
|
|
+export const AppShell = ({
|
|
|
+ enableAccessibilityReporting,
|
|
|
+ amplitudeApiKey,
|
|
|
+ googleAnalyticsId,
|
|
|
+ providers,
|
|
|
+ ...props
|
|
|
+}: AppShellRootProps & AppBodyProps) => (
|
|
|
+ <AppShellRoot
|
|
|
+ enableAccessibilityReporting={enableAccessibilityReporting}
|
|
|
+ amplitudeApiKey={amplitudeApiKey}
|
|
|
+ googleAnalyticsId={googleAnalyticsId}
|
|
|
+ providers={providers}
|
|
|
+ >
|
|
|
+ <AppBody {...props} />
|
|
|
+ </AppShellRoot>
|
|
|
+);
|
|
|
+
|
|
|
type AppBodyProps = Pick<
|
|
|
ComponentProps<typeof Header>,
|
|
|
"appName" | "mainCta" | "extraCta" | "displaySupportButton"
|