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
43 changes: 42 additions & 1 deletion src/components/immersive-landing/ImmersiveLanding.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { Show, splitProps, type Component } from "solid-js";
import { twMerge } from "tailwind-merge";
import type { ImmersiveLandingProps, ImmersiveLandingContextValue } from "./types";
import type {
ImmersiveLandingProps,
ImmersiveLandingContextValue,
} from "./types";
import { useImmersiveLanding } from "./useImmersiveLanding";
import { ImmersiveLandingContext } from "./ImmersiveLandingContext";
import ImmersiveLandingPage from "./ImmersiveLandingPage";
import ImmersiveLandingArrows from "./ImmersiveLandingArrows";
import ImmersiveLandingNavigation from "./ImmersiveLandingNavigation";
import { PWAInstallPrompt } from "./components/PWAInstallPrompt";
import { FirefoxPWABanner } from "./components/FirefoxPWABanner";
import { CookieConsent } from "./components/CookieConsent";

const ImmersiveLanding: Component<ImmersiveLandingProps> = (props) => {
// Don't split children - access directly from props to preserve reactivity
Expand All @@ -25,6 +31,12 @@ const ImmersiveLanding: Component<ImmersiveLandingProps> = (props) => {
"class",
"className",
"style",
"pwaConfig",
"cookieConfig",
"firefoxPWAConfig",
"showPWAPrompt",
"showCookieConsent",
"showFirefoxBanner",
]);

const navigation = useImmersiveLanding({
Expand Down Expand Up @@ -121,6 +133,35 @@ const ImmersiveLanding: Component<ImmersiveLandingProps> = (props) => {
isLastPage={navigation.isLastPage()}
/>
)}

<Show when={local.showPWAPrompt}>
<PWAInstallPrompt
appName={local.pwaConfig?.appName}
appIcon={local.pwaConfig?.appIcon}
storageKey={local.pwaConfig?.storageKey ?? "app_pwa_dismissed"}
texts={local.pwaConfig?.texts}
onInstall={local.pwaConfig?.onInstall}
onDismiss={local.pwaConfig?.onDismiss}
/>
</Show>
<Show when={local.showFirefoxBanner}>
<FirefoxPWABanner
extensionUrl={local.firefoxPWAConfig?.extensionUrl}
storageKey={
local.firefoxPWAConfig?.storageKey ?? "app_firefox_pwa_dismissed"
}
texts={local.firefoxPWAConfig?.texts}
onInstall={local.firefoxPWAConfig?.onInstall}
onDismiss={local.firefoxPWAConfig?.onDismiss}
/>
</Show>
<Show when={local.showCookieConsent}>
<CookieConsent
storageKeys={local.cookieConfig?.storageKeys}
texts={local.cookieConfig?.texts}
onConsentChange={local.cookieConfig?.onConsentChange}
/>
</Show>
</ImmersiveLandingContext.Provider>
);
};
Expand Down
Loading