// Navbar.jsx // // Fully responsive site header: desktop mega-menu for the 15 real product // modules (SPEC-07 Section 0/2), a mobile hamburger drawer, a "Login" link // to the deployed product, and a global "Request a Demo" CTA. Route slugs // match the ones the Footer and EarlyAccessGate.jsx use - see that file's // REAL_MODULES. // // Loaded as a classic (non-module) Babel-transformed script - see // index.html's header comment. React 19 ships no UMD global, so // `window.React` here is the bridge index.html's ESM import sets up; hooks // are called as `React.useState` etc. (fully qualified, not destructured at // top level) because sibling classic scripts share one global lexical // scope - a repeated top-level `const useState = ...` across files is a // SyntaxError there, not a harmless shadow. // Single source of truth for the "Login" link's target - every page loads // this same Navbar.jsx, so changing this one constant updates the link // everywhere at once. Update when the deployed product's real domain changes. const PRODUCT_APP_URL = "https://trans.upmarx.ai"; const PRODUCT_LINKS = [ { slug: "fleet-dispatch", label: "Fleet & Dispatch" }, { slug: "sales-orders", label: "Sales Orders" }, { slug: "purchase-grn", label: "Purchase Orders & GRN" }, { slug: "inventory", label: "Inventory Management" }, { slug: "warehouses", label: "Multi-Warehouse Management" }, { slug: "production-workflow", label: "Production & WIP Workflow Engine" }, { slug: "business-rules", label: "Business Rules Engine" }, { slug: "analytics-dashboards", label: "Analytics & Dashboards" }, { slug: "ai-assistant", label: "AI Business Assistant" }, { slug: "customer-portal", label: "Customer Portal" }, { slug: "customers", label: "Customer Management" }, { slug: "vendors", label: "Vendor Management" }, { slug: "brokers", label: "Broker Management" }, { slug: "roles-permissions", label: "Roles & Permissions" }, { slug: "localization", label: "Localization & Multi-Language" }, ]; const SOLUTION_LINKS = [ { slug: "manufacturing", label: "Manufacturing SMEs" }, { slug: "processing", label: "Processing & Converting" }, { slug: "distribution", label: "Distribution & Logistics" }, ]; const COMPARE_LINKS = [ { slug: "skelbiz-vs-tally-zoho-odoo", label: "Full Comparison" }, { slug: "vs-tally-prime", label: "vs Tally Prime" }, { slug: "vs-zoho", label: "vs Zoho" }, { slug: "vs-odoo", label: "vs Odoo" }, ]; const SIMPLE_LINKS = [ { path: "/pricing", label: "Pricing" }, { path: "/security", label: "Security & Trust" }, ]; function ChevronIcon({ open }) { return ( ); } function MenuIcon() { return ( ); } function CloseIcon() { return ( ); } function DesktopDropdown({ label, isOpen, onToggle, onClose, children }) { const ref = React.useRef(null); // Closing because a real nav link was clicked (page is about to unload for // a full reload - this site has no client-side routing) skips the fade/ // translate transition entirely, instead of animating it. Full-page // navigation means the outgoing page can sit visible for a while longer // while the new page's CDN scripts (Tailwind, Babel, React) load, so an // animated close left a mid-transition dropdown frame hanging/flickering // during that gap - reported as "submenu opening with fluctuation and // disappearing" when clicking Pricing right after opening Product/Solutions. // Closing by clicking elsewhere on the same page still animates normally. const [instantClose, setInstantClose] = React.useState(false); React.useEffect(() => { if (isOpen) setInstantClose(false); }, [isOpen]); React.useEffect(() => { if (!isOpen) return; const onClickAway = (e) => { if (ref.current && !ref.current.contains(e.target)) { setInstantClose(!!e.target.closest("a[href]")); onClose(); } }; document.addEventListener("mousedown", onClickAway); return () => document.removeEventListener("mousedown", onClickAway); }, [isOpen, onClose]); return (