Create rule flow core infrastructure and routing

This commit is contained in:
adilallo
2026-02-07 21:13:46 -07:00
parent 12b1f59886
commit 343b96a9bb
8 changed files with 265 additions and 12 deletions
@@ -0,0 +1,32 @@
"use client";
import { memo } from "react";
import { usePathname } from "next/navigation";
import dynamic from "next/dynamic";
// Code split Footer - below the fold, can be lazy loaded
const Footer = dynamic(() => import("./Footer"), {
loading: () => (
<footer className="bg-[var(--color-surface-default-primary)] w-full min-h-[200px]" />
),
ssr: true, // Keep SSR for SEO
});
/**
* Conditionally renders Footer based on pathname.
* Hides footer for /create/* routes (full-screen create flow).
*/
const ConditionalFooter = memo(() => {
const pathname = usePathname();
const isCreateFlow = pathname?.startsWith("/create");
if (isCreateFlow) {
return null;
}
return <Footer />;
});
ConditionalFooter.displayName = "ConditionalFooter";
export default ConditionalFooter;
@@ -0,0 +1,24 @@
"use client";
import { memo } from "react";
import { usePathname } from "next/navigation";
import TopNavWithPathname from "./TopNav/TopNavWithPathname";
/**
* Conditionally renders TopNav based on pathname.
* Hides navigation for /create/* routes (full-screen create flow).
*/
const ConditionalNavigation = memo(() => {
const pathname = usePathname();
const isCreateFlow = pathname?.startsWith("/create");
if (isCreateFlow) {
return null;
}
return <TopNavWithPathname />;
});
ConditionalNavigation.displayName = "ConditionalNavigation";
export default ConditionalNavigation;
@@ -205,6 +205,7 @@ const TopNavContainer = memo<TopNavProps>(
size={buttonSize}
buttonType={buttonType}
palette={palette}
href="/create/informational"
ariaLabel={t("ariaLabels.createNewRule")}
>
{renderAvatarGroup(containerSize, avatarSize)}