diff --git a/src/Layout.tsx b/src/Layout.tsx
index a48ac14..ab2a28f 100644
--- a/src/Layout.tsx
+++ b/src/Layout.tsx
@@ -1,6 +1,8 @@
-import { ReactNode } from 'react';
-import Navbar from './components/Navbar';
-import { Footer } from './components/Footer';
+import { ReactNode } from "react";
+import { useLocation } from "react-router-dom";
+import Navbar from "./components/Navbar";
+import { Footer } from "./components/Footer";
+import { getAutoNavigationSource } from "./utils/getAutoNavigationSource";
interface User {
email: string;
@@ -10,35 +12,37 @@ interface User {
interface LayoutProps {
children: ReactNode;
activeCity?: string;
- onSignInClick?: () => void;
+ onSignInClick?: () => void;
onSignOutClick?: () => void;
user?: User | null;
}
-export function Layout({
- children,
- activeCity = 'Melbourne',
+export function Layout({
+ children,
+ activeCity,
onSignInClick,
onSignOutClick,
- user
+ user,
}: LayoutProps) {
+ const location = useLocation();
+
+ // 🧠 Use the helper to determine which city to show
+ const cityToUse = activeCity || getAutoNavigationSource(location);
+
return (
- {/* Navbar */}
- {}}
- onSignInClick={() => onSignInClick?.()}
+ onSignInClick={() => onSignInClick?.()}
onSignOutClick={onSignOutClick}
isUserSignedIn={!!user}
user={user}
/>
- {/* Main Content */}
{children}
- {/* Footer */}
);
-}
\ No newline at end of file
+}
diff --git a/src/components/HowItWorksPage.tsx b/src/components/HowItWorksPage.tsx
index 5600757..a15de1f 100644
--- a/src/components/HowItWorksPage.tsx
+++ b/src/components/HowItWorksPage.tsx
@@ -166,7 +166,7 @@ function HeroCarousel({ onCheckoutClick, onPassesClick }: { onCheckoutClick: ()
All-in-One City Pass
-
+
{/* Description */}
-
+
{/* Subtle overlay for depth */}
@@ -327,11 +327,10 @@ function HeroCarousel({ onCheckoutClick, onPassesClick }: { onCheckoutClick: ()
aria-label={`Go to slide ${index + 1}`}
>
))}
@@ -446,13 +445,13 @@ const steps: Step[] = [
];
// Step Component
-function StepSection({
- step,
- index,
+function StepSection({
+ step,
+ index,
onInView
-}: {
- step: Step;
- index: number;
+}: {
+ step: Step;
+ index: number;
onInView: (index: number) => void;
}) {
const ref = useRef(null);
@@ -528,7 +527,7 @@ function StepSection({
)}
-
+
-
-
- {/* Hero Section - Full Carousel */}
-
+
- {/* Unified How It Works Section with Flight Path */}
-
- {/* Curved Flight Path SVG - Desktop Only */}
-
-