Compare commits

..

No commits in common. "31f011ba8c4645a093fbcad158a1951096746cc0" and "dabdbb74ea290eb09496522d1310bf07289b7961" have entirely different histories.

40 changed files with 6575 additions and 60 deletions

File diff suppressed because one or more lines are too long

View file

@ -152,7 +152,6 @@ export default function Layout() {
backBehavior="history" backBehavior="history"
drawerContent={CustomDrawerContent} drawerContent={CustomDrawerContent}
screenOptions={({ navigation, route }) => ({ screenOptions={({ navigation, route }) => ({
swipeEnabled: false,
headerShown: true, headerShown: true,
headerStyle: { headerStyle: {
backgroundColor: theme.colors.gray1, backgroundColor: theme.colors.gray1,
@ -198,26 +197,33 @@ export default function Layout() {
), ),
})} })}
> >
<Drawer.Screen name="dashboard" options={{ title: "Dashboard" }} /> <Drawer.Screen name="dashboard" options={{ title: "Dashboard" }} />
<Drawer.Screen name="add-product" options={{ title: "Add Product" }} />
<Drawer.Screen name="products" options={{ title: "Products" }} /> <Drawer.Screen name="products" options={{ title: "Products" }} />
<Drawer.Screen name="prices-overview" options={{ title: "Prices Overview" }} /> <Drawer.Screen name="prices-overview" options={{ title: "Prices Overview" }} />
<Drawer.Screen name="product-groupings" options={{ title: "Product Groupings" }} /> <Drawer.Screen name="product-groupings" options={{ title: "Product Groupings" }} />
<Drawer.Screen name="create-product-group" options={{ title: "Create Product Group" }} /> <Drawer.Screen name="create-product-group" options={{ title: "Create Product Group" }} />
<Drawer.Screen name="edit-product-group/[id]" options={{ title: "Edit Product Group" }} /> <Drawer.Screen name="edit-product-group/[id]" options={{ title: "Edit Product Group" }} />
<Drawer.Screen name="edit-product" options={{ title: "Edit Product" }} />
<Drawer.Screen <Drawer.Screen
name="manage-orders" name="manage-orders"
options={{ title: "Manage Orders" }} options={{ title: "Manage Orders" }}
/> />
<Drawer.Screen name="complaints" options={{ title: "Complaints" }} /> <Drawer.Screen name="complaints" options={{ title: "Complaints" }} />
<Drawer.Screen name="coupons" options={{ title: "Coupons" }} /> <Drawer.Screen name="coupons" options={{ title: "Coupons" }} />
<Drawer.Screen name="slots" options={{ title: "Slots" }} /> <Drawer.Screen name="create-coupon" options={{ title: "Create Coupon" }} />
<Drawer.Screen name="edit-coupon/[id]" options={{ title: "Edit Coupon" }} />
<Drawer.Screen name="slots" options={{ title: "Slots" }} />
<Drawer.Screen name="add-slot" options={{ title: "Add Slot" }} />
<Drawer.Screen name="edit-slot/[id]" options={{ title: "Edit Slot" }} />
<Drawer.Screen name="vendor-snippets" options={{ title: "Vendor Snippets" }} /> <Drawer.Screen name="vendor-snippets" options={{ title: "Vendor Snippets" }} />
<Drawer.Screen name="delivery-sequences" options={{ title: "Delivery Sequences", headerShown: false }} /> <Drawer.Screen name="delivery-sequences" options={{ title: "Delivery Sequences", headerShown: false }} />
<Drawer.Screen name="stores" options={{ title: "Stores" }} /> <Drawer.Screen name="stores" options={{ title: "Stores" }} />
<Drawer.Screen name="address-management" options={{ title: "Address Management" }} /> <Drawer.Screen name="address-management" options={{ title: "Address Management" }} />
<Drawer.Screen name="product-tags" options={{ title: "Product Tags" }} /> <Drawer.Screen name="product-tags" options={{ title: "Product Tags" }} />
<Drawer.Screen name="add-tag" options={{ title: "Add Tag" }} />
<Drawer.Screen name="edit-tag" options={{ title: "Edit Tag" }} />
<Drawer.Screen name="order-details/[id]" options={{ title: "Order Details" }} /> <Drawer.Screen name="order-details/[id]" options={{ title: "Order Details" }} />
<Drawer.Screen name="orders" options={{ title: "Orders" }} /> <Drawer.Screen name="orders" options={{ title: "Orders" }} />
<Drawer.Screen name="rebalance-orders" options={{ title: "Rebalance Orders" }} /> <Drawer.Screen name="rebalance-orders" options={{ title: "Rebalance Orders" }} />

View file

@ -0,0 +1,15 @@
import { Stack } from "expo-router";
export default function Layout() {
return (
<Stack>
<Stack.Screen
name="index"
options={{
title: "Add Product",
headerShown: false,
}}
/>
</Stack>
);
}

View file

@ -1,8 +1,8 @@
import React from 'react'; import React from 'react';
import { Alert } from 'react-native'; import { Alert } from 'react-native';
import { AppContainer } from 'common-ui'; import { AppContainer } from 'common-ui';
import ProductForm from '@/src/components/ProductForm'; import ProductForm from '../../../src/components/ProductForm';
import { useCreateProduct, CreateProductPayload } from '@/src/api-hooks/product.api'; import { useCreateProduct, CreateProductPayload } from '../../../src/api-hooks/product.api';
export default function AddProduct() { export default function AddProduct() {
const { mutate: createProduct, isPending: isCreating } = useCreateProduct(); const { mutate: createProduct, isPending: isCreating } = useCreateProduct();

View file

@ -0,0 +1,9 @@
import { Stack } from 'expo-router';
export default function Layout() {
return (
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" options={{ title: 'Add Slot' }} />
</Stack>
);
}

View file

@ -1,9 +1,9 @@
import React from 'react'; import React from 'react';
import { View, Text } from 'react-native'; import { View, Text } from 'react-native';
import { AppContainer } from 'common-ui'; import { AppContainer } from 'common-ui';
import SlotForm from '@/components/SlotForm'; import SlotForm from '../../../components/SlotForm';
import { useRouter, useLocalSearchParams } from 'expo-router'; import { useRouter, useLocalSearchParams } from 'expo-router';
import { trpc } from '@/src/trpc-client'; import { trpc } from '../../../src/trpc-client';
export default function AddSlot() { export default function AddSlot() {
const router = useRouter(); const router = useRouter();
@ -35,7 +35,7 @@ export default function AddSlot() {
<AppContainer> <AppContainer>
<SlotForm <SlotForm
onSlotAdded={handleSlotAdded} onSlotAdded={handleSlotAdded}
initialProductIds={baseSlotData?.slot?.products?.map((p: any) => p.id) || []} initialProductIds={baseSlotData?.slot?.products?.map(p => p.id) || []}
initialGroupIds={baseSlotData?.slot?.groupIds || []} initialGroupIds={baseSlotData?.slot?.groupIds || []}
/> />
</AppContainer> </AppContainer>

View file

@ -0,0 +1,9 @@
import { Stack } from 'expo-router';
export default function Layout() {
return (
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" options={{ title: 'Add Store' }} />
</Stack>
);
}

View file

@ -14,7 +14,7 @@ export default function AddStore() {
createStoreMutation.mutate(values, { createStoreMutation.mutate(values, {
onSuccess: (data) => { onSuccess: (data) => {
Alert.alert('Success', data.message); Alert.alert('Success', data.message);
router.push('/stores' as any); // Navigate back to stores list router.push('/(drawer)/stores' as any); // Navigate back to stores list
}, },
onError: (error: any) => { onError: (error: any) => {
Alert.alert('Error', error.message || 'Failed to create store'); Alert.alert('Error', error.message || 'Failed to create store');

View file

@ -0,0 +1,15 @@
import { Stack } from "expo-router";
export default function Layout() {
return (
<Stack>
<Stack.Screen
name="index"
options={{
title: "Add Tag",
headerShown: false,
}}
/>
</Stack>
);
}

View file

@ -2,10 +2,14 @@ import { Stack } from "expo-router";
export default function Layout() { export default function Layout() {
return ( return (
<Stack screenOptions={{ headerShown: false }}> <Stack>
<Stack.Screen name="index" options={{ title: "Coupons" }} /> <Stack.Screen
<Stack.Screen name="create" options={{ title: "Create Coupon" }} /> name="index"
<Stack.Screen name="edit/[id]" options={{ title: "Edit Coupon" }} /> options={{
title: "Coupons",
headerShown: false,
}}
/>
</Stack> </Stack>
); );
} }

View file

@ -90,7 +90,7 @@ const CouponItem = ({ item, onDelete }: { item: any; onDelete: (id: number) => v
<View style={tw`flex-row mt-3 gap-2`}> <View style={tw`flex-row mt-3 gap-2`}>
<TouchableOpacity <TouchableOpacity
onPress={() => router.push(`/coupons/edit/${item.id}`)} onPress={() => router.push(`/(drawer)/edit-coupon/${item.id}`)}
style={tw`bg-blue-500 p-3 rounded-lg shadow-md flex-1 flex-row items-center justify-center`} style={tw`bg-blue-500 p-3 rounded-lg shadow-md flex-1 flex-row items-center justify-center`}
> >
<MaterialCommunityIcons name="pencil" size={16} color="white" /> <MaterialCommunityIcons name="pencil" size={16} color="white" />
@ -497,7 +497,7 @@ export default function Coupons() {
)} )}
/> />
<MyTouchableOpacity <MyTouchableOpacity
onPress={() => router.push('/coupons/create')} onPress={() => router.push('/(drawer)/create-coupon')}
activeOpacity={0.95} activeOpacity={0.95}
style={{ position: 'absolute', bottom: 32, right: 24, zIndex: 100 }} style={{ position: 'absolute', bottom: 32, right: 24, zIndex: 100 }}
> >

View file

@ -217,7 +217,7 @@ export default function ReservedCoupons() {
</View> </View>
<MyText style={tw`text-xl font-semibold text-gray-600 mb-2`}>No Reserved Coupons Yet</MyText> <MyText style={tw`text-xl font-semibold text-gray-600 mb-2`}>No Reserved Coupons Yet</MyText>
<MyText style={tw`text-gray-500 text-center mb-4`}>Create your first reserved coupon to start offering secret discounts</MyText> <MyText style={tw`text-gray-500 text-center mb-4`}>Create your first reserved coupon to start offering secret discounts</MyText>
<MyButton onPress={() => router.push('/coupons/create')} style={tw`bg-blue-500`}> <MyButton onPress={() => router.push('/(drawer)/create-coupon')} style={tw`bg-blue-500`}>
<View style={tw`flex-row items-center`}> <View style={tw`flex-row items-center`}>
<MaterialCommunityIcons name="plus" size={16} color="white" /> <MaterialCommunityIcons name="plus" size={16} color="white" />
<MyText style={tw`text-white font-semibold ml-1`}>Create Reserved Coupon</MyText> <MyText style={tw`text-white font-semibold ml-1`}>Create Reserved Coupon</MyText>
@ -230,7 +230,7 @@ export default function ReservedCoupons() {
{/* FAB for Add New Reserved Coupon */} {/* FAB for Add New Reserved Coupon */}
<MyTouchableOpacity <MyTouchableOpacity
onPress={() => router.push('/coupons/create')} onPress={() => router.push('/(drawer)/create-coupon')}
activeOpacity={0.95} activeOpacity={0.95}
style={{ position: 'absolute', bottom: 32, right: 24, zIndex: 100 }} style={{ position: 'absolute', bottom: 32, right: 24, zIndex: 100 }}
> >

View file

@ -0,0 +1,9 @@
import { Stack } from "expo-router";
export default function Layout() {
return (
<Stack>
<Stack.Screen name="index" options={{ title: "Create Coupon", headerShown: false }} />
</Stack>
);
}

View file

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { View, Alert } from 'react-native'; import { View, Alert } from 'react-native';
import { tw, AppContainer } from 'common-ui'; import { tw, AppContainer } from 'common-ui';
import CouponForm from '@/src/components/CouponForm'; import CouponForm from '../../../src/components/CouponForm';
import { trpc } from '@/src/trpc-client'; import { trpc } from '@/src/trpc-client';
import { useRouter } from 'expo-router'; import { useRouter } from 'expo-router';

View file

@ -91,7 +91,7 @@ export default function Dashboard() {
title: 'Add Product', title: 'Add Product',
icon: 'add-circle', icon: 'add-circle',
description: 'Create a new product listing', description: 'Create a new product listing',
route: '/products/add', route: '/(drawer)/add-product',
category: 'quick', category: 'quick',
iconColor: theme.colors.brand500, iconColor: theme.colors.brand500,
iconBg: theme.colors.brand50, iconBg: theme.colors.brand50,

View file

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { View, Alert } from 'react-native'; import { View, Alert } from 'react-native';
import { tw, AppContainer, MyText } from 'common-ui'; import { tw, AppContainer, MyText } from 'common-ui';
import CouponForm from '@/src/components/CouponForm'; import CouponForm from '../../../../src/components/CouponForm';
import { trpc } from '@/src/trpc-client'; import { trpc } from '@/src/trpc-client';
import { useRouter, useLocalSearchParams } from 'expo-router'; import { useRouter, useLocalSearchParams } from 'expo-router';
import dayjs from 'dayjs'; import dayjs from 'dayjs';

View file

@ -0,0 +1,15 @@
import { Stack } from "expo-router";
export default function Layout() {
return (
<Stack>
<Stack.Screen
name="index"
options={{
title: "Edit Product",
headerShown: false,
}}
/>
</Stack>
);
}

View file

@ -2,8 +2,8 @@ import React, { useRef } from 'react';
import { View, Text, Alert } from 'react-native'; import { View, Text, Alert } from 'react-native';
import { useLocalSearchParams } from 'expo-router'; import { useLocalSearchParams } from 'expo-router';
import { AppContainer, useManualRefresh, MyText, tw } from 'common-ui'; import { AppContainer, useManualRefresh, MyText, tw } from 'common-ui';
import ProductForm, { ProductFormRef } from '@/src/components/ProductForm'; import ProductForm, { ProductFormRef } from '../../../src/components/ProductForm';
import { useUpdateProduct } from '@/src/api-hooks/product.api'; import { useUpdateProduct } from '../../../src/api-hooks/product.api';
import { trpc } from '@/src/trpc-client'; import { trpc } from '@/src/trpc-client';
export default function EditProduct() { export default function EditProduct() {

View file

@ -1,6 +1,8 @@
import React from 'react'; import React from 'react';
import { View, Text } from 'react-native'; import { View, Text } from 'react-native';
import { AppContainer } from 'common-ui'; import { AppContainer } from 'common-ui';
// import SlotForm from '../../../components/SlotForm';
// import { trpc } from '../../../src/trpc-client';
import { useRouter, useLocalSearchParams } from 'expo-router'; import { useRouter, useLocalSearchParams } from 'expo-router';
import { trpc } from '@/src/trpc-client'; import { trpc } from '@/src/trpc-client';
import SlotForm from '@/components/SlotForm'; import SlotForm from '@/components/SlotForm';
@ -43,9 +45,9 @@ export default function EditSlot() {
initialFreezeTime={new Date(slot.slot.freezeTime)} initialFreezeTime={new Date(slot.slot.freezeTime)}
initialIsActive={slot.slot.isActive} initialIsActive={slot.slot.isActive}
slotId={slot.slot.id} slotId={slot.slot.id}
initialProductIds={slot.slot.products?.map((p: any) => p.id) || []} initialProductIds={slot.slot.products?.map(p => p.id) || []}
onSlotAdded={handleSlotUpdated} onSlotAdded={handleSlotUpdated}
/> />
</AppContainer> </AppContainer>
); );
} }

View file

@ -0,0 +1,9 @@
import { Stack } from 'expo-router';
export default function Layout() {
return (
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="[id]" options={{ title: 'Edit Slot' }} />
</Stack>
);
}

View file

@ -0,0 +1,9 @@
import { Stack } from 'expo-router';
export default function Layout() {
return (
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" options={{ title: 'Edit Store' }} />
</Stack>
);
}

View file

@ -23,7 +23,7 @@ export default function EditStore() {
onSuccess: (data) => { onSuccess: (data) => {
refetch(); refetch();
Alert.alert('Success', data.message); Alert.alert('Success', data.message);
router.push('/stores' as any); router.push('/(drawer)/stores' as any);
}, },
onError: (error: any) => { onError: (error: any) => {
Alert.alert('Error', error.message || 'Failed to update store'); Alert.alert('Error', error.message || 'Failed to update store');

View file

@ -0,0 +1,15 @@
import { Stack } from "expo-router";
export default function Layout() {
return (
<Stack>
<Stack.Screen
name="index"
options={{
title: "Edit Tag",
headerShown: false,
}}
/>
</Stack>
);
}

View file

@ -177,7 +177,7 @@ export default function ProductDetail() {
const product = productData?.product; const product = productData?.product;
const handleEdit = () => { const handleEdit = () => {
router.push(`/products/edit?id=${productId}` as any); router.push(`/edit-product?id=${productId}` as any);
}; };

View file

@ -0,0 +1,9 @@
import { Stack } from 'expo-router';
export default function Layout() {
return (
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="[id]" options={{ title: 'Product Detail' }} />
</Stack>
);
}

View file

@ -2,10 +2,14 @@ import { Stack } from "expo-router";
export default function Layout() { export default function Layout() {
return ( return (
<Stack screenOptions={{ headerShown: false }}> <Stack>
<Stack.Screen name="index" options={{ title: "Product Tags" }} /> <Stack.Screen
<Stack.Screen name="add" options={{ title: "Add Tag" }} /> name="index"
<Stack.Screen name="edit/index" options={{ title: "Edit Tag" }} /> options={{
title: "Product Tags",
headerShown: false,
}}
/>
</Stack> </Stack>
); );
} }

View file

@ -78,7 +78,7 @@ export default function ProductTags() {
}; };
const handleAddNewTag = () => { const handleAddNewTag = () => {
router.push('/product-tags/add'); router.push('/(drawer)/add-tag');
}; };

View file

@ -4,9 +4,6 @@ export default function Layout() {
return ( return (
<Stack screenOptions={{ headerShown: false }}> <Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" options={{ title: 'Products' }} /> <Stack.Screen name="index" options={{ title: 'Products' }} />
<Stack.Screen name="add" options={{ title: 'Add Product' }} />
<Stack.Screen name="edit" options={{ title: 'Edit Product' }} />
<Stack.Screen name="detail/[id]" options={{ title: 'Product Detail' }} />
</Stack> </Stack>
); );
} }

View file

@ -48,7 +48,7 @@ export default function Products() {
}, [products, searchTerm, activeFilter]); }, [products, searchTerm, activeFilter]);
const handleEdit = (productId: number) => { const handleEdit = (productId: number) => {
router.push(`/products/edit?id=${productId}` as any); router.push(`/edit-product?id=${productId}` as any);
}; };
@ -80,7 +80,7 @@ export default function Products() {
}; };
const handleViewDetails = (productId: number) => { const handleViewDetails = (productId: number) => {
router.push(`/products/detail/${productId}` as any); router.push(`/product-detail/${productId}` as any);
}; };
const FilterButton = ({ filter, label, count }: { filter: FilterType; label: string; count: number }) => ( const FilterButton = ({ filter, label, count }: { filter: FilterType; label: string; count: number }) => (
@ -129,7 +129,7 @@ export default function Products() {
{/* Header */} {/* Header */}
<View style={tw`flex-row justify-between items-center mb-6`}> <View style={tw`flex-row justify-between items-center mb-6`}>
<MyText style={tw`text-2xl font-bold text-gray-800`}>Products</MyText> <MyText style={tw`text-2xl font-bold text-gray-800`}>Products</MyText>
<MyButton onPress={() => router.push('/products/add' as any)}> <MyButton onPress={() => router.push('/add-product' as any)}>
Add Product Add Product
</MyButton> </MyButton>
</View> </View>

View file

@ -5,8 +5,6 @@ export default function Layout() {
<Stack screenOptions={{ headerShown: false }}> <Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" options={{ title: 'Slots' }} /> <Stack.Screen name="index" options={{ title: 'Slots' }} />
<Stack.Screen name="slot-details" options={{ title: 'Slot Details' }} /> <Stack.Screen name="slot-details" options={{ title: 'Slot Details' }} />
<Stack.Screen name="add" options={{ title: 'Add Slot' }} />
<Stack.Screen name="edit/[id]" options={{ title: 'Edit Slot' }} />
</Stack> </Stack>
); );
} }

View file

@ -2,7 +2,7 @@ import React, { useState } from 'react';
import { MaterialCommunityIcons, Entypo } from '@expo/vector-icons'; import { MaterialCommunityIcons, Entypo } from '@expo/vector-icons';
import { View, TouchableOpacity, FlatList, Alert } from 'react-native'; import { View, TouchableOpacity, FlatList, Alert } from 'react-native';
import { AppContainer, MyText, tw, MyFlatList , BottomDialog, MyTouchableOpacity } from 'common-ui'; import { AppContainer, MyText, tw, MyFlatList , BottomDialog, MyTouchableOpacity } from 'common-ui';
import { trpc } from '@/src/trpc-client'; import { trpc } from '../../../src/trpc-client';
import { useRouter } from 'expo-router'; import { useRouter } from 'expo-router';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { LinearGradient } from 'expo-linear-gradient'; import { LinearGradient } from 'expo-linear-gradient';
@ -47,7 +47,7 @@ const SlotItemComponent: React.FC<SlotItemProps> = ({
</View> </View>
<View style={tw`flex-row items-center`}> <View style={tw`flex-row items-center`}>
<TouchableOpacity <TouchableOpacity
onPress={() => router.push(`/slots/edit/${slot.id}` as any)} onPress={() => router.push(`/edit-slot/${slot.id}` as any)}
style={tw`px-3 py-1 rounded-full bg-pink2 mr-2`} style={tw`px-3 py-1 rounded-full bg-pink2 mr-2`}
> >
<View style={tw`flex-row items-center`}> <View style={tw`flex-row items-center`}>
@ -75,7 +75,7 @@ const SlotItemComponent: React.FC<SlotItemProps> = ({
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
setMenuOpen(false); setMenuOpen(false);
router.push(`/slots/add?baseslot=${slot.id}` as any); router.push(`/add-slot?baseslot=${slot.id}` as any);
}} }}
style={tw`py-4 border-b border-gray-200`} style={tw`py-4 border-b border-gray-200`}
> >
@ -202,7 +202,7 @@ export default function Slots() {
{/* FAB for Add New Slot */} {/* FAB for Add New Slot */}
<MyTouchableOpacity <MyTouchableOpacity
onPress={() => router.push('/slots/add' as any)} onPress={() => router.push('/add-slot' as any)}
activeOpacity={0.95} activeOpacity={0.95}
style={{ position: 'absolute', bottom: 32, right: 24, zIndex: 100 }} style={{ position: 'absolute', bottom: 32, right: 24, zIndex: 100 }}
> >

View file

@ -1,7 +1,7 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { View, ScrollView, TouchableOpacity, Alert, Share } from 'react-native'; import { View, ScrollView, TouchableOpacity, Alert, Share } from 'react-native';
import { theme, AppContainer, MyText, tw, MyTouchableOpacity, BottomDialog } from 'common-ui'; import { theme, AppContainer, MyText, tw, MyTouchableOpacity, BottomDialog } from 'common-ui';
import { trpc } from '@/src/trpc-client'; import { trpc } from '../../../src/trpc-client';
import MaterialIcons from '@expo/vector-icons/MaterialIcons'; import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useRouter, useLocalSearchParams } from 'expo-router'; import { useRouter, useLocalSearchParams } from 'expo-router';

View file

@ -4,8 +4,6 @@ export default function Layout() {
return ( return (
<Stack screenOptions={{ headerShown: false }}> <Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="index" options={{ title: 'Stores' }} /> <Stack.Screen name="index" options={{ title: 'Stores' }} />
<Stack.Screen name="add" options={{ title: 'Add Store' }} />
<Stack.Screen name="edit" options={{ title: 'Edit Store' }} />
</Stack> </Stack>
); );
} }

View file

@ -106,7 +106,7 @@ export default function Stores() {
const stores = storesData?.stores || []; const stores = storesData?.stores || [];
const handleEdit = (storeId: number) => { const handleEdit = (storeId: number) => {
router.push({ pathname: '/stores/edit', params: { id: storeId } }); router.push({ pathname: '/edit-store', params: { id: storeId } });
}; };
const handleDelete = (storeId: number) => { const handleDelete = (storeId: number) => {
@ -207,7 +207,7 @@ export default function Stores() {
<Animated.View entering={FadeInUp.delay(500)} style={tw`absolute bottom-8 right-6 shadow-xl`}> <Animated.View entering={FadeInUp.delay(500)} style={tw`absolute bottom-8 right-6 shadow-xl`}>
<TouchableOpacity <TouchableOpacity
activeOpacity={0.8} activeOpacity={0.8}
onPress={() => router.push('/stores/add' as any)} onPress={() => router.push('/add-store' as any)}
> >
<LinearGradient <LinearGradient
colors={['#2563EB', '#1D4ED8']} colors={['#2563EB', '#1D4ED8']}

View file

@ -34,7 +34,7 @@ export const TagMenu: React.FC<TagMenuProps> = ({
const handleEditTag = () => { const handleEditTag = () => {
setIsOpen(false); setIsOpen(false);
router.push(`/product-tags/edit?tagId=${tagId}`); router.push(`/(drawer)/edit-tag?tagId=${tagId}`);
}; };
const handleDeleteTag = () => { const handleDeleteTag = () => {

View file

@ -15,10 +15,16 @@ export const initFunc = async (): Promise<void> => {
try { try {
console.log('Starting application initialization...'); console.log('Starting application initialization...');
await Promise.all([ // Initialize all stores
initializeAllStores(), await initializeAllStores();
startOrderHandler(),
]); // Notification queue and worker are initialized via import
console.log('Notification queue and worker initialized');
// Start post order handler (Redis Pub/Sub subscriber)
await startOrderHandler();
console.log('Application initialization completed successfully'); console.log('Application initialization completed successfully');
} catch (error) { } catch (error) {

View file

@ -63,8 +63,8 @@ const isDevMode = Constants.executionEnvironment !== "standalone";
// const BASE_API_URL = API_URL; // const BASE_API_URL = API_URL;
// const BASE_API_URL = 'http://10.0.2.2:4000'; // const BASE_API_URL = 'http://10.0.2.2:4000';
// const BASE_API_URL = 'http://192.168.100.101:4000'; // const BASE_API_URL = 'http://192.168.100.101:4000';
// const BASE_API_URL = 'http://192.168.1.3:4000'; const BASE_API_URL = 'http://192.168.1.3:4000';
let BASE_API_URL = "https://mf.freshyo.in"; // let BASE_API_URL = "https://mf.freshyo.in";
// let BASE_API_URL = 'http://192.168.100.104:4000'; // let BASE_API_URL = 'http://192.168.100.104:4000';
// let BASE_API_URL = 'http://192.168.29.176:4000'; // let BASE_API_URL = 'http://192.168.29.176:4000';

6386
session-ses_3ec7.md Normal file

File diff suppressed because one or more lines are too long