From 837fb5d725689896c7c472986f7a4e20d9aa91a2 Mon Sep 17 00:00:00 2001 From: MaheshtheDev <38828053+MaheshtheDev@users.noreply.github.com> Date: Sun, 25 Jan 2026 06:36:23 +0000 Subject: chore: mobile banner for inconsistency and auto redirect in wrong route (#704) --- apps/web/app/new/layout.tsx | 8 ++- apps/web/app/onboarding/page.tsx | 15 +++-- apps/web/components/new/mobile-banner.tsx | 24 ++++++++ .../components/onboarding/new-onboarding-modal.tsx | 66 ++++++++++++++++++++++ .../components/onboarding/onboarding-wrapper.tsx | 12 ++++ 5 files changed, 118 insertions(+), 7 deletions(-) create mode 100644 apps/web/components/new/mobile-banner.tsx create mode 100644 apps/web/components/onboarding/new-onboarding-modal.tsx create mode 100644 apps/web/components/onboarding/onboarding-wrapper.tsx diff --git a/apps/web/app/new/layout.tsx b/apps/web/app/new/layout.tsx index e761fea2..f0cc0c1e 100644 --- a/apps/web/app/new/layout.tsx +++ b/apps/web/app/new/layout.tsx @@ -3,6 +3,7 @@ import { useEffect } from "react" import { useFeatureFlagEnabled } from "posthog-js/react" import { useRouter } from "next/navigation" +import { MobileBanner } from "@/components/new/mobile-banner" export default function NewLayout({ children }: { children: React.ReactNode }) { const router = useRouter() @@ -18,5 +19,10 @@ export default function NewLayout({ children }: { children: React.ReactNode }) { return null } - return <>{children} + return ( + <> + + {children} + + ) } diff --git a/apps/web/app/onboarding/page.tsx b/apps/web/app/onboarding/page.tsx index dcf64ad0..cee9879b 100644 --- a/apps/web/app/onboarding/page.tsx +++ b/apps/web/app/onboarding/page.tsx @@ -4,6 +4,7 @@ import { OnboardingProvider } from "./onboarding-context" import { OnboardingProgressBar } from "./progress-bar" import { redirect } from "next/navigation" import { OnboardingBackground } from "./onboarding-background" +import { OnboardingWrapper } from "@/components/onboarding/onboarding-wrapper" import type { Metadata } from "next" export const metadata: Metadata = { title: "Welcome to Supermemory", @@ -16,11 +17,13 @@ export default function OnboardingPage() { if (!session) redirect("/login") return ( - - - - - - + + + + + + + + ) } diff --git a/apps/web/components/new/mobile-banner.tsx b/apps/web/components/new/mobile-banner.tsx new file mode 100644 index 00000000..245b6952 --- /dev/null +++ b/apps/web/components/new/mobile-banner.tsx @@ -0,0 +1,24 @@ +"use client" + +import { useIsMobile } from "@hooks/use-mobile" +import { cn } from "@lib/utils" + +export function MobileBanner() { + const isMobile = useIsMobile() + + if (!isMobile) { + return null + } + + return ( +
+ 🚧 Mobile responsive in development. Desktop recommended. +
+ ) +} diff --git a/apps/web/components/onboarding/new-onboarding-modal.tsx b/apps/web/components/onboarding/new-onboarding-modal.tsx new file mode 100644 index 00000000..5dc545c1 --- /dev/null +++ b/apps/web/components/onboarding/new-onboarding-modal.tsx @@ -0,0 +1,66 @@ +"use client" + +import { useEffect, useState } from "react" +import { useFeatureFlagEnabled } from "posthog-js/react" +import { useRouter } from "next/navigation" +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogDescription, + DialogFooter, +} from "@ui/components/dialog" +import { Button } from "@ui/components/button" +import { useIsMobile } from "@hooks/use-mobile" + +export function NewOnboardingModal() { + const router = useRouter() + const flagEnabled = useFeatureFlagEnabled("nova-alpha-access") + const isMobile = useIsMobile() + const [open, setOpen] = useState(false) + + useEffect(() => { + if (flagEnabled) { + setOpen(true) + } + }, [flagEnabled]) + + const handleContinue = () => { + setOpen(false) + router.push("/new/onboarding") + } + + if (!flagEnabled) { + return null + } + + return ( + { + if (!isOpen) { + setOpen(false) + } + }}> + e.preventDefault()}> + + Experience the new onboarding + + We've redesigned the onboarding experience. Would you like to try + it? + {isMobile && ( + + Desktop view is recommended for the best experience. + + )} + + + + + + + + + ) +} diff --git a/apps/web/components/onboarding/onboarding-wrapper.tsx b/apps/web/components/onboarding/onboarding-wrapper.tsx new file mode 100644 index 00000000..ee1fcabb --- /dev/null +++ b/apps/web/components/onboarding/onboarding-wrapper.tsx @@ -0,0 +1,12 @@ +"use client" + +import { NewOnboardingModal } from "./new-onboarding-modal" + +export function OnboardingWrapper({ children }: { children: React.ReactNode }) { + return ( + <> + + {children} + + ) +} -- cgit v1.2.3