diff --git a/apps/user-ui/app/(drawer)/(tabs)/flash-delivery/product-detail/_layout.tsx b/apps/user-ui/app/(drawer)/(tabs)/flash-delivery/product-detail/_layout.tsx
new file mode 100644
index 0000000..1791fa3
--- /dev/null
+++ b/apps/user-ui/app/(drawer)/(tabs)/flash-delivery/product-detail/_layout.tsx
@@ -0,0 +1,33 @@
+import { Stack, useNavigation } from 'expo-router';
+import { useEffect } from 'react';
+import { useStoreHeaderStore } from '@/src/store/storeHeaderStore';
+
+function DynamicHeaderTitle() {
+ const navigation = useNavigation();
+ const title = useStoreHeaderStore((state) => state.title);
+
+ useEffect(() => {
+ if (title) {
+ navigation.setOptions({ title });
+ }
+ }, [title, navigation]);
+
+ return null;
+}
+
+export default function ProductDetailLayout() {
+ const title = useStoreHeaderStore((state) => state.title);
+
+ return (
+ <>
+
+
+
+
+ >
+ );
+}
diff --git a/apps/user-ui/app/(drawer)/(tabs)/home/product-detail/_layout.tsx b/apps/user-ui/app/(drawer)/(tabs)/home/product-detail/_layout.tsx
index 871c3ae..c9a32e9 100644
--- a/apps/user-ui/app/(drawer)/(tabs)/home/product-detail/_layout.tsx
+++ b/apps/user-ui/app/(drawer)/(tabs)/home/product-detail/_layout.tsx
@@ -1,20 +1,39 @@
import FloatingCartBar from "@/components/floating-cart-bar";
import { tw } from "common-ui";
-import { Stack } from "expo-router";
+import { Stack, useNavigation } from 'expo-router';
import { View } from "react-native";
+import { useEffect } from 'react';
+import { useStoreHeaderStore } from '@/src/store/storeHeaderStore';
+
+function DynamicHeaderTitle() {
+ const navigation = useNavigation();
+ const title = useStoreHeaderStore((state) => state.title);
+
+ useEffect(() => {
+ if (title) {
+ navigation.setOptions({ title });
+ }
+ }, [title, navigation]);
+
+ return null;
+}
export default function ProductDetailLayout() {
+ const title = useStoreHeaderStore((state) => state.title);
+
return (
<>
+
+ >
+
+
>
);
-}
\ No newline at end of file
+}
diff --git a/apps/user-ui/app/(drawer)/(tabs)/order-again/product-detail/_layout.tsx b/apps/user-ui/app/(drawer)/(tabs)/order-again/product-detail/_layout.tsx
new file mode 100644
index 0000000..1791fa3
--- /dev/null
+++ b/apps/user-ui/app/(drawer)/(tabs)/order-again/product-detail/_layout.tsx
@@ -0,0 +1,33 @@
+import { Stack, useNavigation } from 'expo-router';
+import { useEffect } from 'react';
+import { useStoreHeaderStore } from '@/src/store/storeHeaderStore';
+
+function DynamicHeaderTitle() {
+ const navigation = useNavigation();
+ const title = useStoreHeaderStore((state) => state.title);
+
+ useEffect(() => {
+ if (title) {
+ navigation.setOptions({ title });
+ }
+ }, [title, navigation]);
+
+ return null;
+}
+
+export default function ProductDetailLayout() {
+ const title = useStoreHeaderStore((state) => state.title);
+
+ return (
+ <>
+
+
+
+
+ >
+ );
+}
diff --git a/apps/user-ui/app/(drawer)/(tabs)/stores/store-detail/product-detail/_layout.tsx b/apps/user-ui/app/(drawer)/(tabs)/stores/store-detail/product-detail/_layout.tsx
index 7d1194a..1791fa3 100644
--- a/apps/user-ui/app/(drawer)/(tabs)/stores/store-detail/product-detail/_layout.tsx
+++ b/apps/user-ui/app/(drawer)/(tabs)/stores/store-detail/product-detail/_layout.tsx
@@ -1,12 +1,33 @@
-import { Stack } from 'expo-router';
+import { Stack, useNavigation } from 'expo-router';
+import { useEffect } from 'react';
+import { useStoreHeaderStore } from '@/src/store/storeHeaderStore';
+
+function DynamicHeaderTitle() {
+ const navigation = useNavigation();
+ const title = useStoreHeaderStore((state) => state.title);
+
+ useEffect(() => {
+ if (title) {
+ navigation.setOptions({ title });
+ }
+ }, [title, navigation]);
+
+ return null;
+}
export default function ProductDetailLayout() {
+ const title = useStoreHeaderStore((state) => state.title);
+
return (
-
+ <>
+
+
+
+
+ >
);
-}
\ No newline at end of file
+}
diff --git a/apps/user-ui/components/ProductDetail.tsx b/apps/user-ui/components/ProductDetail.tsx
index 5d9e343..cb08edf 100644
--- a/apps/user-ui/components/ProductDetail.tsx
+++ b/apps/user-ui/components/ProductDetail.tsx
@@ -13,6 +13,7 @@ import { useAddToCart, useGetCart, useUpdateCartItem, useRemoveFromCart } from '
import { useProductSlotIdentifier } from '@/hooks/useProductSlotIdentifier';
import { useFlashNavigationStore } from '@/components/stores/flashNavigationStore';
import FloatingCartBar from './floating-cart-bar';
+import { useStoreHeaderStore } from '@/src/store/storeHeaderStore';
const { width: screenWidth } = Dimensions.get("window");
const carouselWidth = screenWidth;
@@ -182,6 +183,12 @@ const ProductDetail: React.FC = ({ productId, isFlashDeliver
}
}, [productDetail?.id]);
+ // Set the store header title with product name
+ const setStoreHeaderTitle = useStoreHeaderStore((state) => state.setTitle);
+ if (productDetail?.name) {
+ setStoreHeaderTitle(productDetail.name);
+ }
+
if (isLoading) {
return (
@@ -200,7 +207,6 @@ const ProductDetail: React.FC = ({ productId, isFlashDeliver
);
}
-
return (
{/* */}