Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
085f87842f | ||
|
|
5cf454274c | ||
|
|
48f18fc2ee | ||
|
|
514b64dcd1 |
85 changed files with 3770 additions and 1379 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -150,3 +150,5 @@ apps/admin-ui/.expo/cache/*
|
||||||
# Local wrangler dev vars (may hold local-only secrets)
|
# Local wrangler dev vars (may hold local-only secrets)
|
||||||
.dev.vars
|
.dev.vars
|
||||||
apps/*/.dev.vars
|
apps/*/.dev.vars
|
||||||
|
|
||||||
|
**/store-screenshots/
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
"icon": "./assets/images/symbuyoteadmin.png",
|
"icon": "./assets/images/symbuyoteadmin.png",
|
||||||
"scheme": "freshyoadmin",
|
"scheme": "freshyoadmin",
|
||||||
"userInterfaceStyle": "automatic",
|
"userInterfaceStyle": "automatic",
|
||||||
"newArchEnabled": true,
|
|
||||||
"ios": {
|
"ios": {
|
||||||
"supportsTablet": true,
|
"supportsTablet": true,
|
||||||
"bundleIdentifier": "in.freshyo.adminui",
|
"bundleIdentifier": "in.freshyo.adminui",
|
||||||
|
|
@ -62,10 +61,9 @@
|
||||||
"foregroundImage": "./assets/images/symbuyoteadmin.png",
|
"foregroundImage": "./assets/images/symbuyoteadmin.png",
|
||||||
"backgroundColor": "#fff0f6"
|
"backgroundColor": "#fff0f6"
|
||||||
},
|
},
|
||||||
"edgeToEdgeEnabled": true,
|
"package": "in.freshyo.adminui",
|
||||||
"package": "in.freshyo.adminui",
|
"googleServicesFile": "./google-services.json",
|
||||||
"googleServicesFile": "./google-services.json",
|
"intentFilters": [
|
||||||
"intentFilters": [
|
|
||||||
{
|
{
|
||||||
"action": "VIEW",
|
"action": "VIEW",
|
||||||
"autoVerify": true,
|
"autoVerify": true,
|
||||||
|
|
@ -76,7 +74,10 @@
|
||||||
"pathPrefix": "/manage-orders/order-details"
|
"pathPrefix": "/manage-orders/order-details"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"category": ["BROWSABLE", "DEFAULT"]
|
"category": [
|
||||||
|
"BROWSABLE",
|
||||||
|
"DEFAULT"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -96,9 +97,9 @@
|
||||||
"backgroundColor": "#ffffff"
|
"backgroundColor": "#ffffff"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"expo-secure-store",
|
"expo-secure-store",
|
||||||
"expo-notifications"
|
"expo-notifications"
|
||||||
],
|
],
|
||||||
"experiments": {
|
"experiments": {
|
||||||
"typedRoutes": true
|
"typedRoutes": true
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import { Drawer } from "expo-router/drawer";
|
import { Drawer, DrawerContentScrollView, DrawerItem } from "expo-router/drawer";
|
||||||
import { DrawerContentScrollView, DrawerItem } from "@react-navigation/drawer";
|
|
||||||
import { useRouter, Redirect } from "expo-router";
|
import { useRouter, Redirect } from "expo-router";
|
||||||
import {
|
import {
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
|
|
@ -76,91 +75,91 @@ function CustomDrawerContent() {
|
||||||
label="Dashboard"
|
label="Dashboard"
|
||||||
onPress={() => router.dismissTo("/(drawer)/dashboard" as any)}
|
onPress={() => router.dismissTo("/(drawer)/dashboard" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="dashboard" size={size} color={color} />
|
<MaterialIcons name="dashboard" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Products"
|
label="Products"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/products" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/products" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="inventory" size={size} color={color} />
|
<MaterialIcons name="inventory" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Prices Overview"
|
label="Prices Overview"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/prices-overview" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/prices-overview" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="attach-money" size={size} color={color} />
|
<MaterialIcons name="attach-money" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Product Groupings"
|
label="Product Groupings"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/product-groupings" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/product-groupings" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="group-work" size={size} color={color} />
|
<MaterialIcons name="group-work" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Dashboard Banners"
|
label="Dashboard Banners"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/dashboard-banners" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/dashboard-banners" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="view-carousel" size={size} color={color} />
|
<MaterialIcons name="view-carousel" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Slots"
|
label="Slots"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/slots" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/slots" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="schedule" size={size} color={color} />
|
<MaterialIcons name="schedule" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Complaints"
|
label="Complaints"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/complaints" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/complaints" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="report-problem" size={size} color={color} />
|
<MaterialIcons name="report-problem" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Manage Orders"
|
label="Manage Orders"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/manage-orders" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/manage-orders" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="shopping-bag" size={size} color={color} />
|
<MaterialIcons name="shopping-bag" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Coupons"
|
label="Coupons"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/coupons" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/coupons" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="local-offer" size={size} color={color} />
|
<MaterialIcons name="local-offer" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Stores"
|
label="Stores"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/stores" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/stores" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="store" size={size} color={color} />
|
<MaterialIcons name="store" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="User Management"
|
label="User Management"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/user-management" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/user-management" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="people" size={size} color={color} />
|
<MaterialIcons name="people" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Send Notifications"
|
label="Send Notifications"
|
||||||
onPress={() => router.push("/(drawer)/dashboard/send-notifications" as any)}
|
onPress={() => router.push("/(drawer)/dashboard/send-notifications" as any)}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="campaign" size={size} color={color} />
|
<MaterialIcons name="campaign" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<DrawerItem
|
<DrawerItem
|
||||||
label="Logout"
|
label="Logout"
|
||||||
onPress={() => logout()}
|
onPress={() => logout()}
|
||||||
icon={({ color, size }) => (
|
icon={({ color, size }) => (
|
||||||
<MaterialIcons name="logout" size={size} color={color} />
|
<MaterialIcons name="logout" size={size} color={color as string} />
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</DrawerContentScrollView>
|
</DrawerContentScrollView>
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ export default function Complaints() {
|
||||||
<ActivityIndicator size="small" color="#3B82F6" />
|
<ActivityIndicator size="small" color="#3B82F6" />
|
||||||
<MyText style={tw`text-gray-500 ml-2`}>Loading more...</MyText>
|
<MyText style={tw`text-gray-500 ml-2`}>Loading more...</MyText>
|
||||||
</View>
|
</View>
|
||||||
) : null
|
) : undefined
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<ConfirmationDialog
|
<ConfirmationDialog
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ export default function CouponDetails() {
|
||||||
<ScrollView
|
<ScrollView
|
||||||
style={tw`flex-1`}
|
style={tw`flex-1`}
|
||||||
contentContainerStyle={tw`p-4 pb-10`}
|
contentContainerStyle={tw`p-4 pb-10`}
|
||||||
refreshControl={<RefreshControl refreshing={isFetching} onRefresh={refetch} />}
|
refreshControl={<RefreshControl refreshing={isFetching} onRefresh={() => { void refetch() }} />}
|
||||||
>
|
>
|
||||||
<View style={tw`bg-white rounded-2xl p-5 mb-4 shadow-sm`}>
|
<View style={tw`bg-white rounded-2xl p-5 mb-4 shadow-sm`}>
|
||||||
<View style={tw`flex-row items-center flex-wrap`}>
|
<View style={tw`flex-row items-center flex-wrap`}>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { View, TouchableOpacity, Alert } from 'react-native';
|
import { View, TouchableOpacity, Alert } from 'react-native';
|
||||||
import { MyText, BottomDropdown, tw, MyFlatList, useMarkDataFetchers } from 'common-ui';
|
import { MyText, BottomDropdown, tw, MyFlatList, useMarkDataFetchers } from 'common-ui';
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter, useFocusEffect } from 'expo-router';
|
||||||
import { useFocusEffect } from '@react-navigation/native';
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useState, useCallback } from 'react';
|
import { useState, useCallback } from 'react';
|
||||||
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
|
|
|
||||||
|
|
@ -556,7 +556,7 @@ export default function Orders() {
|
||||||
<ActivityIndicator size="small" color="#3B82F6" />
|
<ActivityIndicator size="small" color="#3B82F6" />
|
||||||
<MyText style={tw`text-gray-600 ml-2`}>Loading more...</MyText>
|
<MyText style={tw`text-gray-600 ml-2`}>Loading more...</MyText>
|
||||||
</View>
|
</View>
|
||||||
) : null
|
) : undefined
|
||||||
),
|
),
|
||||||
[isFetchingNextPage]
|
[isFetchingNextPage]
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ export default function Stores() {
|
||||||
numColumns={2}
|
numColumns={2}
|
||||||
columnWrapperStyle={tw`justify-start`}
|
columnWrapperStyle={tw`justify-start`}
|
||||||
contentContainerStyle={tw`p-2 pb-24`}
|
contentContainerStyle={tw`p-2 pb-24`}
|
||||||
refreshControl={<RefreshControl refreshing={isLoading} onRefresh={refetch} />}
|
refreshControl={<RefreshControl refreshing={isLoading} onRefresh={() => { void refetch() }} />}
|
||||||
ListHeaderComponent={
|
ListHeaderComponent={
|
||||||
<Animated.View entering={FadeInDown.duration(600)} style={tw`mb-8 mt-4 px-1`}>
|
<Animated.View entering={FadeInDown.duration(600)} style={tw`mb-8 mt-4 px-1`}>
|
||||||
<View style={tw`flex-row justify-between items-end mb-2`}>
|
<View style={tw`flex-row justify-between items-end mb-2`}>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
import { QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClientProvider } from "@tanstack/react-query";
|
||||||
import queryClient from "../utils/queryClient";
|
import queryClient from "../utils/queryClient";
|
||||||
import { Stack } from "expo-router";
|
import { Stack } from "expo-router";
|
||||||
|
import { useFonts } from "expo-font";
|
||||||
|
import * as SplashScreen from "expo-splash-screen";
|
||||||
|
import { Provider as PaperProvider } from "react-native-paper";
|
||||||
|
import { INTER_FONTS, PAPER_THEME } from "common-ui";
|
||||||
import { LogBox } from "react-native";
|
import { LogBox } from "react-native";
|
||||||
|
import { useEffect } from "react";
|
||||||
import { StaffAuthProvider } from "@/components/context/staff-auth-context";
|
import { StaffAuthProvider } from "@/components/context/staff-auth-context";
|
||||||
import { trpc, trpcClient } from "@/src/trpc-client";
|
import { trpc, trpcClient } from "@/src/trpc-client";
|
||||||
import { SafeAreaView } from "react-native-safe-area-context";
|
import { SafeAreaView } from "react-native-safe-area-context";
|
||||||
|
|
@ -17,21 +22,33 @@ if (__DEV__) {
|
||||||
LogBox.ignoreAllLogs(true);
|
LogBox.ignoreAllLogs(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SplashScreen.preventAutoHideAsync();
|
||||||
|
|
||||||
export default function Layout() {
|
export default function Layout() {
|
||||||
|
const [fontsLoaded, fontError] = useFonts(INTER_FONTS);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (fontsLoaded || fontError) SplashScreen.hideAsync();
|
||||||
|
}, [fontsLoaded, fontError]);
|
||||||
|
|
||||||
|
if (!fontsLoaded && !fontError) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<trpc.Provider client={trpcClient} queryClient={queryClient}>
|
<trpc.Provider client={trpcClient} queryClient={queryClient}>
|
||||||
<StaffAuthProvider>
|
<StaffAuthProvider>
|
||||||
<NotificationProvider>
|
<NotificationProvider>
|
||||||
<SafeAreaView
|
<PaperProvider theme={PAPER_THEME}>
|
||||||
edges={['left', 'right', 'bottom']}
|
<SafeAreaView
|
||||||
style={{ flex: 1, backgroundColor: '#fff' }}
|
edges={['left', 'right', 'bottom']}
|
||||||
testID="app-root"
|
style={{ flex: 1, backgroundColor: '#fff' }}
|
||||||
>
|
testID="app-root"
|
||||||
<RefreshProvider queryClient={queryClient}>
|
>
|
||||||
<Stack screenOptions={{ headerShown: false }} />
|
<RefreshProvider queryClient={queryClient}>
|
||||||
</RefreshProvider>
|
<Stack screenOptions={{ headerShown: false }} />
|
||||||
</SafeAreaView>
|
</RefreshProvider>
|
||||||
|
</SafeAreaView>
|
||||||
|
</PaperProvider>
|
||||||
<NotifChecker />
|
<NotifChecker />
|
||||||
<Toast />
|
<Toast />
|
||||||
</NotificationProvider>
|
</NotificationProvider>
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,9 @@ config.resolver.nodeModulesPaths = [
|
||||||
path.resolve(workspaceRoot, 'node_modules'),
|
path.resolve(workspaceRoot, 'node_modules'),
|
||||||
];
|
];
|
||||||
|
|
||||||
// 3. Force Metro to resolve (sub)dependencies only from the top-level `node_modules`
|
// 3. Keep Metro's default hierarchical lookup: forcing it off breaks packages
|
||||||
config.resolver.disableHierarchicalLookup = true;
|
// that ship their own nested dependency (react-native-reanimated 4 ships a
|
||||||
|
// semver@7 used by its worklets version check, while the root has semver@6).
|
||||||
|
|
||||||
// 4. Ensure Metro correctly resolves the entry point for expo-router
|
// 4. Ensure Metro correctly resolves the entry point for expo-router
|
||||||
// This is crucial for web builds in a monorepo with expo-router
|
// This is crucial for web builds in a monorepo with expo-router
|
||||||
|
|
|
||||||
|
|
@ -14,76 +14,64 @@
|
||||||
"test:typecheck": "tsc --noEmit --project tsconfig.json"
|
"test:typecheck": "tsc --noEmit --project tsconfig.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/vector-icons": "^14.1.0",
|
"@expo/vector-icons": "^15.0.2",
|
||||||
"@react-native-community/datetimepicker": "8.4.1",
|
"@react-native-community/datetimepicker": "9.2.1",
|
||||||
"@react-native-picker/picker": "2.11.1",
|
|
||||||
"@react-navigation/bottom-tabs": "^7.3.10",
|
|
||||||
"@react-navigation/drawer": "^7.3.9",
|
"@react-navigation/drawer": "^7.3.9",
|
||||||
"@react-navigation/elements": "^2.3.8",
|
|
||||||
"@react-navigation/material-top-tabs": "^7.4.11",
|
|
||||||
"@react-navigation/native": "^7.1.6",
|
"@react-navigation/native": "^7.1.6",
|
||||||
"@tanstack/react-query": "^5.100.0",
|
"@tanstack/react-query": "^5.100.0",
|
||||||
"@trpc/client": "^11.6.0",
|
"@trpc/client": "^11.6.0",
|
||||||
"@trpc/react-query": "^11.6.0",
|
"@trpc/react-query": "^11.6.0",
|
||||||
"axios": "^1.11.0",
|
|
||||||
"buffer": "^6.0.3",
|
|
||||||
"date-fns": "^4.1.0",
|
"date-fns": "^4.1.0",
|
||||||
"dayjs": "^1.11.18",
|
"dayjs": "^1.11.18",
|
||||||
"expo": "~53.0.22",
|
"expo": "~58.0.26",
|
||||||
"expo-blur": "~14.1.5",
|
"expo-blur": "~58.0.6",
|
||||||
"expo-constants": "~17.1.7",
|
"expo-constants": "~58.0.16",
|
||||||
"expo-device": "~7.1.4",
|
"expo-device": "~58.0.5",
|
||||||
"expo-document-picker": "~13.1.6",
|
"expo-document-picker": "~58.0.5",
|
||||||
"expo-font": "~13.3.2",
|
"expo-font": "~58.0.12",
|
||||||
"expo-haptics": "~14.1.4",
|
"expo-image": "~58.0.18",
|
||||||
"expo-image": "~2.4.0",
|
"expo-image-picker": "~58.0.10",
|
||||||
"expo-image-picker": "~16.1.4",
|
"expo-linear-gradient": "~58.0.4",
|
||||||
"expo-linear-gradient": "~14.1.5",
|
"expo-linking": "~58.0.17",
|
||||||
"expo-linking": "~7.1.7",
|
"expo-location": "~58.0.22",
|
||||||
"expo-location": "^19.0.8",
|
"expo-notifications": "~58.1.9",
|
||||||
"expo-notifications": "~0.31.4",
|
"expo-router": "~58.0.32",
|
||||||
"expo-router": "~5.1.5",
|
"expo-secure-store": "~58.0.3",
|
||||||
"expo-secure-store": "~14.2.4",
|
"expo-splash-screen": "~58.0.14",
|
||||||
"expo-splash-screen": "~0.30.10",
|
"expo-status-bar": "~58.0.5",
|
||||||
"expo-status-bar": "~2.2.3",
|
"expo-system-ui": "~58.0.7",
|
||||||
"expo-symbols": "~0.4.5",
|
"expo-updates": "~58.0.22",
|
||||||
"expo-system-ui": "~5.0.11",
|
|
||||||
"expo-updates": "~0.28.17",
|
|
||||||
"expo-web-browser": "~14.2.0",
|
|
||||||
"formik": "^2.4.6",
|
"formik": "^2.4.6",
|
||||||
"jwt-decode": "^4.0.0",
|
"react": "19.3.0",
|
||||||
"react": "19.0.0",
|
"react-dom": "19.3.0",
|
||||||
"react-dom": "19.0.0",
|
"react-native": "0.88.1",
|
||||||
"react-hook-form": "^7.62.0",
|
|
||||||
"react-native": "0.79.6",
|
|
||||||
"react-native-draggable-flatlist": "^4.0.3",
|
"react-native-draggable-flatlist": "^4.0.3",
|
||||||
"react-native-element-dropdown": "^2.12.4",
|
"react-native-gesture-handler": "~3.3.0",
|
||||||
"react-native-gesture-handler": "~2.24.0",
|
"react-native-pager-view": "9.0.7",
|
||||||
"react-native-pager-view": "6.7.1",
|
|
||||||
"react-native-paper": "^5.14.5",
|
"react-native-paper": "^5.14.5",
|
||||||
"react-native-reanimated": "~3.17.4",
|
"react-native-reanimated": "4.7.1",
|
||||||
"react-native-safe-area-context": "5.4.0",
|
"react-native-safe-area-context": "~5.11.1",
|
||||||
"react-native-screens": "~4.11.1",
|
"react-native-screens": "~4.30.1",
|
||||||
"react-native-tab-view": "^4.1.3",
|
"react-native-tab-view": "^4.1.3",
|
||||||
"react-native-toast-message": "^2.3.3",
|
"react-native-toast-message": "^2.3.3",
|
||||||
"react-native-web": "~0.20.0",
|
"react-native-web": "~0.21.4",
|
||||||
"react-native-webview": "13.13.5",
|
"react-native-worklets": "0.13.0",
|
||||||
"twrnc": "^4.9.1",
|
"twrnc": "^4.9.1",
|
||||||
"yup": "^1.7.0"
|
"yup": "^1.7.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.25.2",
|
"@babel/core": "^7.25.2",
|
||||||
"@types/react": "~19.0.10",
|
|
||||||
"@types/react-native-razorpay": "^2.2.6",
|
|
||||||
"eslint": "^9.25.0",
|
|
||||||
"eslint-config-expo": "~9.2.0",
|
|
||||||
"typescript": "~5.8.3",
|
|
||||||
"@testing-library/react-native": "^13",
|
"@testing-library/react-native": "^13",
|
||||||
"@types/jest": "^29",
|
"@types/jest": "30.0.0",
|
||||||
"babel-preset-expo": "~13.0.0",
|
"@types/react": "~19.3.0",
|
||||||
"jest": "~29.7.0",
|
"@types/react-native-razorpay": "^2.2.6",
|
||||||
"jest-expo": "~53.0.0",
|
"babel-preset-expo": "~58.0.26",
|
||||||
"react-test-renderer": "19.0.0"
|
"eslint": "^9.25.0",
|
||||||
|
"eslint-config-expo": "~58.0.4",
|
||||||
|
"jest": "~30.5.2",
|
||||||
|
"jest-expo": "~58.0.15",
|
||||||
|
"react-test-renderer": "19.0.0",
|
||||||
|
"typescript": "~6.0.3"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,14 +153,8 @@ export const NotificationProvider: React.FC<ReactParentComponent> = ({
|
||||||
);
|
);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
if (notificationListener.current) {
|
notificationListener.current?.remove();
|
||||||
Notifications.removeNotificationSubscription(
|
responseListener.current?.remove();
|
||||||
notificationListener.current
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (responseListener.current) {
|
|
||||||
Notifications.removeNotificationSubscription(responseListener.current);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}, [openFromNotification]);
|
}, [openFromNotification]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@ import React, { useState, useEffect } from 'react';
|
||||||
import { View, Text, TouchableOpacity, FlatList } from 'react-native';
|
import { View, Text, TouchableOpacity, FlatList } from 'react-native';
|
||||||
import { Formik } from 'formik';
|
import { Formik } from 'formik';
|
||||||
import * as Yup from 'yup';
|
import * as Yup from 'yup';
|
||||||
import { MyTextInput, MyButton, tw, AppContainer , DateTimePickerMod, Checkbox, BottomDialog, MyText } from 'common-ui';
|
import { MyTextInput, MyButton, tw, AppContainer , Checkbox, BottomDialog, MyText } from 'common-ui';
|
||||||
|
import DateTimePickerMod from 'common-ui/src/components/date-time-picker';
|
||||||
import { trpc } from '../trpc-client';
|
import { trpc } from '../trpc-client';
|
||||||
import ProductsSelector from '@/components/ProductsSelector';
|
import ProductsSelector from '@/components/ProductsSelector';
|
||||||
|
|
||||||
|
|
@ -490,7 +491,7 @@ export default function CouponForm({ onSubmit, isLoading, initialValues }: Coupo
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onEndReachedThreshold={0.5}
|
onEndReachedThreshold={0.5}
|
||||||
ListFooterComponent={isFetchingUsers ? <Text style={tw`text-center p-3`}>Loading...</Text> : null}
|
ListFooterComponent={isFetchingUsers ? <Text style={tw`text-center p-3`}>Loading...</Text> : undefined}
|
||||||
style={tw`max-h-60`}
|
style={tw`max-h-60`}
|
||||||
/>
|
/>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
|
|
||||||
|
|
@ -100,10 +100,10 @@ describe('Root layout (AROOT-01..09)', () => {
|
||||||
const view = renderLayout()
|
const view = renderLayout()
|
||||||
await flush()
|
await flush()
|
||||||
|
|
||||||
expect(Notifications.removeNotificationSubscription).not.toHaveBeenCalled()
|
expect(notificationsMock.__getListenerCounts()).toEqual({ received: 1, response: 1 })
|
||||||
view.unmount()
|
view.unmount()
|
||||||
|
|
||||||
expect(Notifications.removeNotificationSubscription).toHaveBeenCalledTimes(2)
|
expect(notificationsMock.__getListenerCounts()).toEqual({ received: 0, response: 0 })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('AROOT-06: a tap that launched the app opens that order', async () => {
|
it('AROOT-06: a tap that launched the app opens that order', async () => {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { act } from '@testing-library/react-native'
|
import { act } from '@testing-library/react-native'
|
||||||
import { fireEvent } from '@testing-library/react-native'
|
import { fireEvent } from '@testing-library/react-native'
|
||||||
import { Checkbox, DateTimePickerMod } from 'common-ui'
|
import { Checkbox } from 'common-ui'
|
||||||
|
import DateTimePickerMod from 'common-ui/src/components/date-time-picker'
|
||||||
|
|
||||||
import CouponForm from '@/src/components/CouponForm'
|
import CouponForm from '@/src/components/CouponForm'
|
||||||
import { renderWithProviders, flush } from '../helpers/test-utils'
|
import { renderWithProviders, flush } from '../helpers/test-utils'
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,11 @@ export function __emitNotification(notification: any) {
|
||||||
receivedListeners.forEach((listener) => listener(notification))
|
receivedListeners.forEach((listener) => listener(notification))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const __getListenerCounts = () => ({
|
||||||
|
received: receivedListeners.length,
|
||||||
|
response: responseListeners.length,
|
||||||
|
})
|
||||||
|
|
||||||
export function __emitResponse(response: any) {
|
export function __emitResponse(response: any) {
|
||||||
responseListeners.forEach((listener) => listener(response))
|
responseListeners.forEach((listener) => listener(response))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ async function renderBanners(banners = [banner()], options: { stateful?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
function icon(view: View, name: string) {
|
function icon(view: View, name: string) {
|
||||||
return view.UNSAFE_getAllByType(MaterialIcons).find((node: any) => node.props.name === name)
|
return view.UNSAFE_getAllByType(MaterialIcons).find((node: any) => node.props.name === name)!
|
||||||
}
|
}
|
||||||
|
|
||||||
async function confirmDelete(alertSpy: jest.SpyInstance) {
|
async function confirmDelete(alertSpy: jest.SpyInstance) {
|
||||||
|
|
|
||||||
|
|
@ -343,7 +343,7 @@ describe('Coupons list (ACOUPUI-01..30)', () => {
|
||||||
const icon = view
|
const icon = view
|
||||||
.UNSAFE_getAllByType(MaterialCommunityIcons)
|
.UNSAFE_getAllByType(MaterialCommunityIcons)
|
||||||
.find((node: any) => node.props.name === 'plus')
|
.find((node: any) => node.props.name === 'plus')
|
||||||
fireEvent.press(icon)
|
fireEvent.press(icon!)
|
||||||
|
|
||||||
expect(router.push).toHaveBeenCalledWith('/(drawer)/dashboard/coupons/create')
|
expect(router.push).toHaveBeenCalledWith('/(drawer)/dashboard/coupons/create')
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ async function renderGroups(groups: any[] = [GROUP_1]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function icon(view: View, name: string) {
|
function icon(view: View, name: string) {
|
||||||
return view.UNSAFE_getAllByType(MaterialIcons).find((node: any) => node.props.name === name)
|
return view.UNSAFE_getAllByType(MaterialIcons).find((node: any) => node.props.name === name)!
|
||||||
}
|
}
|
||||||
|
|
||||||
async function confirmDelete(alertSpy: jest.SpyInstance) {
|
async function confirmDelete(alertSpy: jest.SpyInstance) {
|
||||||
|
|
|
||||||
10
apps/admin-ui/tests/types/jest-globals.d.ts
vendored
Normal file
10
apps/admin-ui/tests/types/jest-globals.d.ts
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
/**
|
||||||
|
* jest 30's @types/jest no longer declares the global `jest` object — it moved
|
||||||
|
* to `@jest/globals`. The suites still use `jest.fn()`, `jest.mock()`, etc. as
|
||||||
|
* globals, so re-declare it here instead of importing it in every test file.
|
||||||
|
*/
|
||||||
|
declare global {
|
||||||
|
const jest: typeof import('@jest/globals').jest
|
||||||
|
}
|
||||||
|
|
||||||
|
export {}
|
||||||
|
|
@ -10,11 +10,27 @@
|
||||||
"@backend/*": [
|
"@backend/*": [
|
||||||
"../backend/src/*"
|
"../backend/src/*"
|
||||||
],
|
],
|
||||||
"shared-types": ["../shared-types"],
|
"shared-types": [
|
||||||
"common-ui": ["../../packages/ui"],
|
"../shared-types"
|
||||||
"common-ui/*": ["../../packages/ui/*"]
|
],
|
||||||
|
"common-ui": [
|
||||||
|
"../../packages/ui"
|
||||||
|
],
|
||||||
|
"common-ui/*": [
|
||||||
|
"../../packages/ui/*"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"moduleSuffixes": [".ios", ".android", ".native", ".web", ""]
|
"moduleSuffixes": [
|
||||||
|
".ios",
|
||||||
|
".android",
|
||||||
|
".native",
|
||||||
|
".web",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"types": [
|
||||||
|
"jest",
|
||||||
|
"node"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
|
|
|
||||||
|
|
@ -67,3 +67,27 @@ tests/
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
!.env.example
|
!.env.example
|
||||||
|
|
||||||
|
# --- Local build artifacts: installers are never inputs to a build ---
|
||||||
|
# (two committed APKs alone were ~145 MB of the upload archive)
|
||||||
|
*.apk
|
||||||
|
*.aab
|
||||||
|
*.ipa
|
||||||
|
*.hbc
|
||||||
|
*.hbc.map
|
||||||
|
|
||||||
|
# --- Local dev caches / tool state ---
|
||||||
|
.wrangler/
|
||||||
|
**/.wrangler/
|
||||||
|
.opencode/
|
||||||
|
.maestro-output/
|
||||||
|
.playwright-mcp/
|
||||||
|
.commandcode/
|
||||||
|
.agents/
|
||||||
|
react-scan-reports/
|
||||||
|
address_util/
|
||||||
|
|
||||||
|
# --- Local databases and SQL dumps ---
|
||||||
|
*.sqlite
|
||||||
|
*.sqlite3
|
||||||
|
dumps/
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,19 @@
|
||||||
"expo": {
|
"expo": {
|
||||||
"name": "Freshyo",
|
"name": "Freshyo",
|
||||||
"slug": "freshyo",
|
"slug": "freshyo",
|
||||||
"version": "1.2.0",
|
"version": "1.3.0",
|
||||||
"orientation": "portrait",
|
"orientation": "portrait",
|
||||||
"icon": "./assets/images/freshyo-logo.png",
|
"icon": "./assets/images/freshyo-logo.png",
|
||||||
"scheme": "freshyo",
|
"scheme": "freshyo",
|
||||||
"userInterfaceStyle": "automatic",
|
"userInterfaceStyle": "automatic",
|
||||||
"newArchEnabled": true,
|
|
||||||
"ios": {
|
"ios": {
|
||||||
"buildNumber": "1.1.0",
|
"buildNumber": "1.1.0",
|
||||||
"supportsTablet": true,
|
"supportsTablet": true,
|
||||||
"bundleIdentifier": "com.freshyotrial.app",
|
"bundleIdentifier": "com.freshyotrial.app",
|
||||||
|
"associatedDomains": [
|
||||||
|
"applinks:www.freshyo.in",
|
||||||
|
"applinks:app.freshyo.in"
|
||||||
|
],
|
||||||
"infoPlist": {
|
"infoPlist": {
|
||||||
"LSApplicationQueriesSchemes": [
|
"LSApplicationQueriesSchemes": [
|
||||||
"ppemerchantsdkv1",
|
"ppemerchantsdkv1",
|
||||||
|
|
@ -61,14 +64,49 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
|
"blockedPermissions": [
|
||||||
|
"android.permission.READ_MEDIA_IMAGES",
|
||||||
|
"android.permission.READ_MEDIA_VIDEO"
|
||||||
|
],
|
||||||
"softwareKeyboardLayoutMode": "resize",
|
"softwareKeyboardLayoutMode": "resize",
|
||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
"foregroundImage": "./assets/images/freshyo-logo.png",
|
"foregroundImage": "./assets/images/freshyo-logo.png",
|
||||||
"backgroundColor": "#fff0f6"
|
"backgroundColor": "#fff0f6"
|
||||||
},
|
},
|
||||||
"edgeToEdgeEnabled": true,
|
|
||||||
"package": "in.freshyo.app",
|
"package": "in.freshyo.app",
|
||||||
"googleServicesFile": "./google-services.json"
|
"googleServicesFile": "./google-services.json",
|
||||||
|
"intentFilters": [
|
||||||
|
{
|
||||||
|
"action": "VIEW",
|
||||||
|
"autoVerify": true,
|
||||||
|
"category": [
|
||||||
|
"BROWSABLE",
|
||||||
|
"DEFAULT"
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"scheme": "https",
|
||||||
|
"host": "www.freshyo.in",
|
||||||
|
"pathPrefix": "/mobileoffers/"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"action": "VIEW",
|
||||||
|
"autoVerify": true,
|
||||||
|
"category": [
|
||||||
|
"BROWSABLE",
|
||||||
|
"DEFAULT"
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"scheme": "https",
|
||||||
|
"host": "app.freshyo.in",
|
||||||
|
"pathPrefix": "/"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"web": {
|
"web": {
|
||||||
"bundler": "metro",
|
"bundler": "metro",
|
||||||
|
|
@ -87,7 +125,18 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"expo-secure-store",
|
"expo-secure-store",
|
||||||
"expo-notifications"
|
"expo-notifications",
|
||||||
|
"expo-sharing",
|
||||||
|
"expo-sqlite",
|
||||||
|
"@react-native-community/datetimepicker",
|
||||||
|
"expo-video",
|
||||||
|
[
|
||||||
|
"expo-camera",
|
||||||
|
{
|
||||||
|
"cameraPermission": "Freshyo uses the camera to scan offer QR codes and to attach photos to your reviews and complaints.",
|
||||||
|
"recordAudioAndroid": false
|
||||||
|
}
|
||||||
|
]
|
||||||
],
|
],
|
||||||
"experiments": {
|
"experiments": {
|
||||||
"typedRoutes": true
|
"typedRoutes": true
|
||||||
|
|
@ -100,7 +149,6 @@
|
||||||
},
|
},
|
||||||
"runtimeVersion": {
|
"runtimeVersion": {
|
||||||
"policy": "appVersion"
|
"policy": "appVersion"
|
||||||
|
|
||||||
},
|
},
|
||||||
"updates": {
|
"updates": {
|
||||||
"url": "https://u.expo.dev/7f3e7611-f7a8-45f9-8a99-c2b1f6454d48"
|
"url": "https://u.expo.dev/7f3e7611-f7a8-45f9-8a99-c2b1f6454d48"
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ function Login() {
|
||||||
const [resendCountdown, setResendCountdown] = useState(0);
|
const [resendCountdown, setResendCountdown] = useState(0);
|
||||||
const [otpCells, setOtpCells] = useState(['', '', '', '']);
|
const [otpCells, setOtpCells] = useState(['', '', '', '']);
|
||||||
const intervalRef = useRef<any | null>(null);
|
const intervalRef = useRef<any | null>(null);
|
||||||
const inputRefs = useRef<(TextInput | null)[]>([null, null, null, null]);
|
const inputRefs = useRef<(React.ComponentRef<typeof TextInput> | null)[]>([null, null, null, null]);
|
||||||
|
|
||||||
// Terms and Conditions state
|
// Terms and Conditions state
|
||||||
const [termsAccepted, setTermsAccepted] = useState(true);
|
const [termsAccepted, setTermsAccepted] = useState(true);
|
||||||
|
|
@ -534,7 +534,9 @@ function Login() {
|
||||||
<View style={tw`mt-4`}>
|
<View style={tw`mt-4`}>
|
||||||
<MyButton
|
<MyButton
|
||||||
testID="user-login-submit"
|
testID="user-login-submit"
|
||||||
onPress={handleSubmit(onSubmit)}
|
onPress={() => {
|
||||||
|
void handleSubmit(onSubmit)();
|
||||||
|
}}
|
||||||
fillColor="brand600"
|
fillColor="brand600"
|
||||||
textColor="white1"
|
textColor="white1"
|
||||||
fullWidth
|
fullWidth
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter, useFocusEffect } from 'expo-router';
|
||||||
import { View, Alert } from 'react-native';
|
import { View, Alert } from 'react-native';
|
||||||
import { FlashDeliveryProducts } from '@/components/SlotSpecificView';
|
import { FlashDeliveryProducts } from '@/components/SlotSpecificView';
|
||||||
import FlashDeliveryNote from '@/components/FlashDeliveryNote';
|
import FlashDeliveryNote from '@/components/FlashDeliveryNote';
|
||||||
import { useFlashNavigationStore } from '@/components/stores/flashNavigationStore';
|
import { useFlashNavigationStore } from '@/components/stores/flashNavigationStore';
|
||||||
import { useFocusEffect } from '@react-navigation/native';
|
|
||||||
import { useFlashCartStore } from '@/src/store/flashCartStore';
|
import { useFlashCartStore } from '@/src/store/flashCartStore';
|
||||||
import { tw, BottomDialog, MyText, MyTouchableOpacity } from 'common-ui';
|
import { tw, BottomDialog, MyText, MyTouchableOpacity } from 'common-ui';
|
||||||
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@ import React from 'react';
|
||||||
import { View, Linking, TouchableOpacity, ActivityIndicator } from 'react-native';
|
import { View, Linking, TouchableOpacity, ActivityIndicator } from 'react-native';
|
||||||
import { Image } from 'expo-image';
|
import { Image } from 'expo-image';
|
||||||
import { MyText, tw, useManualRefresh, MyFlatList, useMarkDataFetchers, theme, MyTouchableOpacity } from 'common-ui';
|
import { MyText, tw, useManualRefresh, MyFlatList, useMarkDataFetchers, theme, MyTouchableOpacity } from 'common-ui';
|
||||||
import { MaterialIcons, Ionicons } from '@expo/vector-icons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
||||||
import { trpc } from '@/src/trpc-client';
|
import { trpc } from '@/src/trpc-client';
|
||||||
import { useGetEssentialConsts } from '@/src/hooks/prominent-api-hooks';
|
import { useGetEssentialConsts } from '@/src/hooks/prominent-api-hooks';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import React, { useState, useCallback } from 'react';
|
import React, { useState, useCallback } from 'react';
|
||||||
import { View, ScrollView, Alert } from 'react-native';
|
import { View, ScrollView, Alert } from 'react-native';
|
||||||
import { AppContainer, MyText, tw, useMarkDataFetchers, MyTouchableOpacity, MyTextInput } from 'common-ui';
|
import { AppContainer, MyText, tw, useMarkDataFetchers, MyTouchableOpacity, MyTextInput } from 'common-ui';
|
||||||
import { useLocalSearchParams, useRouter } from 'expo-router';
|
import { useLocalSearchParams, useRouter, useFocusEffect } from 'expo-router';
|
||||||
import { useFocusEffect } from '@react-navigation/native';
|
|
||||||
import { useAppStore } from '@/src/store/appStore';
|
import { useAppStore } from '@/src/store/appStore';
|
||||||
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';
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { View, ScrollView, Linking } from 'react-native';
|
import { View, ScrollView, Linking } from 'react-native';
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter, useFocusEffect } from 'expo-router';
|
||||||
import { useFocusEffect } from '@react-navigation/native';
|
|
||||||
import { AppContainer, MyText, tw, MyTouchableOpacity, ProfileImage, colors } from 'common-ui';
|
import { AppContainer, MyText, tw, MyTouchableOpacity, ProfileImage, colors } from 'common-ui';
|
||||||
import TabLayoutWrapper from '@/components/TabLayoutWrapper';
|
import TabLayoutWrapper from '@/components/TabLayoutWrapper';
|
||||||
import { LinearGradient } from 'expo-linear-gradient';
|
import { LinearGradient } from 'expo-linear-gradient';
|
||||||
import { Ionicons } from '@expo/vector-icons';
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
||||||
import NextOrderGlimpse from '@/components/NextOrderGlimpse';
|
import NextOrderGlimpse from '@/components/NextOrderGlimpse';
|
||||||
import AddressSwitcherSheet from '@/src/components/location/AddressSwitcherSheet';
|
import AddressSwitcherSheet from '@/src/components/location/AddressSwitcherSheet';
|
||||||
import { useRegion } from '@/src/hooks/useRegion';
|
import { useRegion } from '@/src/hooks/useRegion';
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import React, { useState, useCallback, useEffect } from 'react';
|
import React, { useState, useCallback, useEffect } from 'react';
|
||||||
import { View, FlatList, Alert, ActivityIndicator } from 'react-native';
|
import { View, FlatList, Alert, ActivityIndicator } from 'react-native';
|
||||||
import { Image } from 'expo-image';
|
import { Image } from 'expo-image';
|
||||||
import { MaterialIcons, Ionicons } from '@expo/vector-icons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter } from 'expo-router';
|
||||||
import { tw, useManualRefresh, MyText, MyFlatList, useMarkDataFetchers, MyTouchableOpacity, theme } from 'common-ui';
|
import { tw, useManualRefresh, MyText, MyFlatList, useMarkDataFetchers, MyTouchableOpacity, theme } from 'common-ui';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { View, ScrollView } from 'react-native';
|
import { View, ScrollView } from 'react-native';
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter } from 'expo-router';
|
||||||
import { AppContainer, MyText, tw, MyTouchableOpacity } from 'common-ui';
|
import { AppContainer, MyText, tw, MyTouchableOpacity } from 'common-ui';
|
||||||
import { Ionicons } from '@expo/vector-icons';
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
||||||
import { TermsAndConditionsContent } from '@/components/TermsAndConditions';
|
import { TermsAndConditionsContent } from '@/components/TermsAndConditions';
|
||||||
|
|
||||||
export default function TermsAndConditions() {
|
export default function TermsAndConditions() {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import {
|
||||||
MyTouchableOpacity,
|
MyTouchableOpacity,
|
||||||
} from "common-ui";
|
} from "common-ui";
|
||||||
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
|
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import Ionicons from "@expo/vector-icons/Ionicons";
|
||||||
import { useStores } from "@/src/hooks/prominent-api-hooks";
|
import { useStores } from "@/src/hooks/prominent-api-hooks";
|
||||||
import { LinearGradient } from "expo-linear-gradient";
|
import { LinearGradient } from "expo-linear-gradient";
|
||||||
import TabLayoutWrapper from "@/components/TabLayoutWrapper";
|
import TabLayoutWrapper from "@/components/TabLayoutWrapper";
|
||||||
|
|
@ -136,7 +136,7 @@ const StoreCard = ({
|
||||||
</MyTouchableOpacity>
|
</MyTouchableOpacity>
|
||||||
<View style={tw`h-8`} />
|
<View style={tw`h-8`} />
|
||||||
</View>
|
</View>
|
||||||
) : null}
|
) : undefined}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ import {
|
||||||
MyText,
|
MyText,
|
||||||
} from "common-ui";
|
} from "common-ui";
|
||||||
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
|
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
|
||||||
import FontAwesome5 from "@expo/vector-icons/FontAwesome5";
|
|
||||||
import ProductCard from "@/components/ProductCard";
|
import ProductCard from "@/components/ProductCard";
|
||||||
import FloatingCartBar from "@/components/floating-cart-bar";
|
import FloatingCartBar from "@/components/floating-cart-bar";
|
||||||
import { useStoreHeaderStore } from "@/src/store/storeHeaderStore";
|
import { useStoreHeaderStore } from "@/src/store/storeHeaderStore";
|
||||||
|
|
@ -161,7 +160,7 @@ export default function StoreDetail() {
|
||||||
<View
|
<View
|
||||||
style={tw`w-16 h-16 bg-pink-50 rounded-full items-center justify-center mb-4`}
|
style={tw`w-16 h-16 bg-pink-50 rounded-full items-center justify-center mb-4`}
|
||||||
>
|
>
|
||||||
<FontAwesome5
|
<MaterialIcons
|
||||||
name="store"
|
name="store"
|
||||||
size={28}
|
size={28}
|
||||||
color={theme.colors.brand500}
|
color={theme.colors.brand500}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import {
|
||||||
StatusBar,
|
StatusBar,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { LinearGradient } from "expo-linear-gradient";
|
import { LinearGradient } from "expo-linear-gradient";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import Ionicons from "@expo/vector-icons/Ionicons";
|
||||||
import { useAuth } from "@/src/contexts/AuthContext";
|
import { useAuth } from "@/src/contexts/AuthContext";
|
||||||
import { tw, theme, MyTouchableOpacity, MyText } from "common-ui";
|
import { tw, theme, MyTouchableOpacity, MyText } from "common-ui";
|
||||||
import HomeIcon from "@/components/icons/HomeIcon";
|
import HomeIcon from "@/components/icons/HomeIcon";
|
||||||
|
|
@ -58,7 +58,7 @@ export default function Layout() {
|
||||||
tabBarLabel: 'Home',
|
tabBarLabel: 'Home',
|
||||||
tabBarButtonTestID: 'tab-home',
|
tabBarButtonTestID: 'tab-home',
|
||||||
tabBarIcon: ({ color, size, focused }) => (
|
tabBarIcon: ({ color, size, focused }) => (
|
||||||
<HomeIcon focused={focused} size={size} color={color} />
|
<HomeIcon focused={focused} size={size} color={color as string} />
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
@ -68,7 +68,7 @@ export default function Layout() {
|
||||||
tabBarLabel: 'Offers',
|
tabBarLabel: 'Offers',
|
||||||
tabBarButtonTestID: 'tab-offers',
|
tabBarButtonTestID: 'tab-offers',
|
||||||
tabBarIcon: ({ color, size, focused }) => (
|
tabBarIcon: ({ color, size, focused }) => (
|
||||||
<OffersIcon focused={focused} size={size} color={color} />
|
<OffersIcon focused={focused} size={size} color={color as string} />
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
@ -105,7 +105,7 @@ export default function Layout() {
|
||||||
tabBarLabel: 'Stores',
|
tabBarLabel: 'Stores',
|
||||||
tabBarButtonTestID: 'tab-stores',
|
tabBarButtonTestID: 'tab-stores',
|
||||||
tabBarIcon: ({ color, size, focused }) => (
|
tabBarIcon: ({ color, size, focused }) => (
|
||||||
<StoresIcon focused={focused} size={size} color={color} />
|
<StoresIcon focused={focused} size={size} color={color as string} />
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
@ -115,7 +115,7 @@ export default function Layout() {
|
||||||
tabBarLabel: 'Me',
|
tabBarLabel: 'Me',
|
||||||
tabBarButtonTestID: 'tab-me',
|
tabBarButtonTestID: 'tab-me',
|
||||||
tabBarIcon: ({ color, size, focused }) => (
|
tabBarIcon: ({ color, size, focused }) => (
|
||||||
<MeIcon focused={focused} size={size} color={color} />
|
<MeIcon focused={focused} size={size} color={color as string} />
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,17 @@
|
||||||
import {
|
|
||||||
DarkTheme,
|
import { Stack, DarkTheme, DefaultTheme, ThemeProvider } from "expo-router";
|
||||||
DefaultTheme,
|
|
||||||
ThemeProvider,
|
|
||||||
} from "@react-navigation/native";
|
|
||||||
import { useFonts } from "expo-font";
|
|
||||||
import { Stack } from "expo-router";
|
|
||||||
import "react-native-reanimated";
|
import "react-native-reanimated";
|
||||||
|
|
||||||
import { useColorScheme } from "@/hooks/useColorScheme";
|
import { useColorScheme } from "@/hooks/useColorScheme";
|
||||||
import { Appearance, StatusBar, View, LogBox } from "react-native";
|
import { Appearance, StatusBar, View, LogBox } from "react-native";
|
||||||
import { QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClientProvider } from "@tanstack/react-query";
|
||||||
import { theme , MyStatusBar } from "common-ui";
|
import { theme , MyStatusBar, INTER_FONTS, PAPER_THEME } from "common-ui";
|
||||||
import queryClient from "@/utils/queryClient";
|
import queryClient from "@/utils/queryClient";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
import { NotificationProvider } from "@/services/notif-service/notif-context";
|
import { NotificationProvider } from "@/services/notif-service/notif-context";
|
||||||
import { Provider as PaperProvider } from "react-native-paper";
|
import { Provider as PaperProvider } from "react-native-paper";
|
||||||
|
import { useFonts } from "expo-font";
|
||||||
|
import * as SplashScreen from "expo-splash-screen";
|
||||||
import { AuthProvider } from "@/src/contexts/AuthContext";
|
import { AuthProvider } from "@/src/contexts/AuthContext";
|
||||||
import { trpc, trpcClient } from "@/src/trpc-client";
|
import { trpc, trpcClient } from "@/src/trpc-client";
|
||||||
import { SafeAreaView, SafeAreaProvider } from "react-native-safe-area-context";
|
import { SafeAreaView, SafeAreaProvider } from "react-native-safe-area-context";
|
||||||
|
|
@ -42,19 +39,23 @@ if (__DEV__) {
|
||||||
LogBox.ignoreAllLogs(true);
|
LogBox.ignoreAllLogs(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Keep the native splash up until Inter is ready, so no screen renders in the
|
||||||
|
// system font first.
|
||||||
|
SplashScreen.preventAutoHideAsync();
|
||||||
|
|
||||||
export default function RootLayout() {
|
export default function RootLayout() {
|
||||||
const colorScheme = useColorScheme();
|
const colorScheme = useColorScheme();
|
||||||
const [loaded] = useFonts({
|
const [fontsLoaded, fontError] = useFonts(INTER_FONTS);
|
||||||
SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"),
|
|
||||||
});
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
Appearance.setColorScheme('light')
|
Appearance.setColorScheme('light')
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (!loaded) {
|
React.useEffect(() => {
|
||||||
return null;
|
if (fontsLoaded || fontError) SplashScreen.hideAsync();
|
||||||
}
|
}, [fontsLoaded, fontError]);
|
||||||
|
|
||||||
|
if (!fontsLoaded && !fontError) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GestureHandlerRootView style={{ flex: 1 }}>
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
||||||
|
|
@ -80,7 +81,7 @@ export default function RootLayout() {
|
||||||
<NotificationProvider>
|
<NotificationProvider>
|
||||||
<NotifChecker />
|
<NotifChecker />
|
||||||
<NotifRegionSync />
|
<NotifRegionSync />
|
||||||
<PaperProvider>
|
<PaperProvider theme={PAPER_THEME}>
|
||||||
<RefreshProvider queryClient={queryClient}>
|
<RefreshProvider queryClient={queryClient}>
|
||||||
<CentralStoreInitializer>
|
<CentralStoreInitializer>
|
||||||
<ImageCacheTtl />
|
<ImageCacheTtl />
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 519 KiB |
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { View, Text, TouchableOpacity, ScrollView, Alert, NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
|
import { View, TouchableOpacity, ScrollView, Alert, NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter } from 'expo-router';
|
||||||
import { tw, BottomDialog, RawBottomDialog, MyText } from 'common-ui';
|
import { tw, BottomDialog, RawBottomDialog, MyText } from 'common-ui';
|
||||||
import { useQueryClient } from '@tanstack/react-query';
|
import { useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
@ -30,7 +30,7 @@ const CheckoutAddressSelector: React.FC<AddressSelectorProps> = ({
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const utils = trpc.useUtils();
|
const utils = trpc.useUtils();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const scrollViewRef = useRef<ScrollView>(null);
|
const scrollViewRef = useRef<React.ComponentRef<typeof ScrollView>>(null);
|
||||||
const { isAuthenticated } = useAuth();
|
const { isAuthenticated } = useAuth();
|
||||||
const { regionId: selectedRegionId } = useRegion();
|
const { regionId: selectedRegionId } = useRegion();
|
||||||
const { data: addresses } = trpc.user.address.getUserAddresses.useQuery(
|
const { data: addresses } = trpc.user.address.getUserAddresses.useQuery(
|
||||||
|
|
@ -176,21 +176,21 @@ const CheckoutAddressSelector: React.FC<AddressSelectorProps> = ({
|
||||||
>
|
>
|
||||||
<MaterialIcons name="location-on" size={18} color="#3B82F6" />
|
<MaterialIcons name="location-on" size={18} color="#3B82F6" />
|
||||||
</View>
|
</View>
|
||||||
<Text style={tw`text-base font-bold text-gray-900`}>
|
<MyText style={tw`text-base font-bold text-gray-900`}>
|
||||||
Delivery Address
|
Delivery Address
|
||||||
</Text>
|
</MyText>
|
||||||
</View>
|
</View>
|
||||||
<TouchableOpacity testID="add-new-address" onPress={() => setShowAddAddress(true)}>
|
<TouchableOpacity testID="add-new-address" onPress={() => setShowAddAddress(true)}>
|
||||||
<Text style={tw`text-brand500 font-bold text-sm`}>+ Add New</Text>
|
<MyText style={tw`text-brand500 font-bold text-sm`}>+ Add New</MyText>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{(!sortedAddresses || sortedAddresses.length === 0) ? (
|
{(!sortedAddresses || sortedAddresses.length === 0) ? (
|
||||||
<View style={tw`bg-gray-50 p-6 rounded-xl border border-gray-200 border-dashed items-center justify-center`}>
|
<View style={tw`bg-gray-50 p-6 rounded-xl border border-gray-200 border-dashed items-center justify-center`}>
|
||||||
<MaterialIcons name="location-off" size={32} color="#9CA3AF" />
|
<MaterialIcons name="location-off" size={32} color="#9CA3AF" />
|
||||||
<Text style={tw`text-gray-500 mt-2`}>No addresses found</Text>
|
<MyText style={tw`text-gray-500 mt-2`}>No addresses found</MyText>
|
||||||
<TouchableOpacity testID="add-address-empty" onPress={() => setShowAddAddress(true)} style={tw`mt-3 bg-brand500 px-4 py-2 rounded-lg`}>
|
<TouchableOpacity testID="add-address-empty" onPress={() => setShowAddAddress(true)} style={tw`mt-3 bg-brand500 px-4 py-2 rounded-lg`}>
|
||||||
<Text style={tw`text-white font-bold text-sm`}>Add Address</Text>
|
<MyText style={tw`text-white font-bold text-sm`}>Add Address</MyText>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -221,9 +221,9 @@ const CheckoutAddressSelector: React.FC<AddressSelectorProps> = ({
|
||||||
size={20}
|
size={20}
|
||||||
color={selectedAddress === address.id ? '#EC4899' : '#6B7280'}
|
color={selectedAddress === address.id ? '#EC4899' : '#6B7280'}
|
||||||
/>
|
/>
|
||||||
<Text style={tw`font-bold ml-2 ${selectedAddress === address.id ? 'text-brand500' : 'text-gray-900'}`}>
|
<MyText style={tw`font-bold ml-2 ${selectedAddress === address.id ? 'text-brand500' : 'text-gray-900'}`}>
|
||||||
{address.name}
|
{address.name}
|
||||||
</Text>
|
</MyText>
|
||||||
</View>
|
</View>
|
||||||
{selectedAddress === address.id && (
|
{selectedAddress === address.id && (
|
||||||
<View style={tw`bg-brand500 w-5 h-5 rounded-full items-center justify-center`}>
|
<View style={tw`bg-brand500 w-5 h-5 rounded-full items-center justify-center`}>
|
||||||
|
|
@ -231,15 +231,15 @@ const CheckoutAddressSelector: React.FC<AddressSelectorProps> = ({
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
<Text style={tw`text-gray-600 text-sm leading-5 mb-1`} numberOfLines={2}>
|
<MyText style={tw`text-gray-600 text-sm leading-5 mb-1`} numberOfLines={2}>
|
||||||
{address.addressLine1}{address.addressLine2 ? `, ${address.addressLine2}` : ''}
|
{address.addressLine1}{address.addressLine2 ? `, ${address.addressLine2}` : ''}
|
||||||
</Text>
|
</MyText>
|
||||||
<Text style={tw`text-gray-600 text-sm mb-1`}>
|
<MyText style={tw`text-gray-600 text-sm mb-1`}>
|
||||||
{address.city}, {address.state}
|
{address.city}, {address.state}
|
||||||
</Text>
|
</MyText>
|
||||||
<Text style={tw`text-gray-500 text-xs mt-2`}>
|
<MyText style={tw`text-gray-500 text-xs mt-2`}>
|
||||||
Phone: {address.phone}
|
Phone: {address.phone}
|
||||||
</Text>
|
</MyText>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
))}
|
))}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
@ -274,9 +274,9 @@ const CheckoutAddressSelector: React.FC<AddressSelectorProps> = ({
|
||||||
disabled={locationLoading && editingLocationAddressId === selectedAddr.id}
|
disabled={locationLoading && editingLocationAddressId === selectedAddr.id}
|
||||||
style={tw`mt-2 py-2 px-3 bg-blue-50 rounded-lg self-start`}
|
style={tw`mt-2 py-2 px-3 bg-blue-50 rounded-lg self-start`}
|
||||||
>
|
>
|
||||||
<Text style={tw`text-blue-600 text-sm font-bold`}>
|
<MyText style={tw`text-blue-600 text-sm font-bold`}>
|
||||||
{locationLoading && editingLocationAddressId === selectedAddr.id ? 'Attaching...' : '+ Attach Current Location'}
|
{locationLoading && editingLocationAddressId === selectedAddr.id ? 'Attaching...' : '+ Attach Current Location'}
|
||||||
</Text>
|
</MyText>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</>
|
</>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { View, TextInput, ActivityIndicator, Alert } from 'react-native';
|
import { View, TextInput, ActivityIndicator, Alert } from 'react-native';
|
||||||
import { MaterialIcons } from '@expo/vector-icons'
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';import { MyText, ImageUploaderNeo, tw, MyTouchableOpacity, type ImageUploaderNeoItem, type ImageUploaderNeoPayload } from 'common-ui'
|
||||||
import { MyText, ImageUploaderNeo, tw, MyTouchableOpacity, type ImageUploaderNeoItem, type ImageUploaderNeoPayload } from 'common-ui'
|
|
||||||
import { trpc } from '@/src/trpc-client'
|
import { trpc } from '@/src/trpc-client'
|
||||||
import { useUploadToObjectStorage } from '../hooks/useUploadToObjectStore'
|
import { useUploadToObjectStorage } from '../hooks/useUploadToObjectStore'
|
||||||
import type { ComplaintFormProps } from '@packages/shared'
|
import type { ComplaintFormProps } from '@packages/shared'
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { View, TouchableOpacity, ActivityIndicator, Linking, ScrollView, Dimensi
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter } from 'expo-router';
|
||||||
import { tw, MyText } from 'common-ui';
|
import { tw, MyText } from 'common-ui';
|
||||||
import { useNavigationTarget } from 'common-ui/hooks/useNavigationTarget';
|
import { useNavigationTarget } from 'common-ui/hooks/useNavigationTarget';
|
||||||
import { MaterialIcons } from '@expo/vector-icons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { trpc } from '@/src/trpc-client';
|
import { trpc } from '@/src/trpc-client';
|
||||||
import { orderStatusManipulator } from '@/src/lib/string-manipulators';
|
import { orderStatusManipulator } from '@/src/lib/string-manipulators';
|
||||||
|
|
@ -124,7 +124,7 @@ export default function NextOrderGlimpse() {
|
||||||
const { setNavigationTarget } = useNavigationTarget();
|
const { setNavigationTarget } = useNavigationTarget();
|
||||||
const userDetails = useUserDetails();
|
const userDetails = useUserDetails();
|
||||||
const [currentIndex, setCurrentIndex] = useState(0);
|
const [currentIndex, setCurrentIndex] = useState(0);
|
||||||
const scrollViewRef = useRef<ScrollView>(null);
|
const scrollViewRef = useRef<React.ComponentRef<typeof ScrollView>>(null);
|
||||||
|
|
||||||
const { data: ordersData, isLoading: ordersLoading } = trpc.user.order.getOrders.useQuery({
|
const { data: ordersData, isLoading: ordersLoading } = trpc.user.order.getOrders.useQuery({
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { View, Alert, TextInput, ActivityIndicator } from 'react-native';
|
import { View, Alert, TextInput, ActivityIndicator } from 'react-native';
|
||||||
import { MaterialIcons, Ionicons } from '@expo/vector-icons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
||||||
import { tw, MyText, MyTouchableOpacity, BottomDialog } from 'common-ui';
|
import { tw, MyText, MyTouchableOpacity, BottomDialog } from 'common-ui';
|
||||||
import { trpc } from '@/src/trpc-client';
|
import { trpc } from '@/src/trpc-client';
|
||||||
import ComplaintForm from '@/components/ComplaintForm';
|
import ComplaintForm from '@/components/ComplaintForm';
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import { useRegion } from '@/src/hooks/useRegion';
|
||||||
import { useCheckoutStore } from '@/src/store/checkoutStore';
|
import { useCheckoutStore } from '@/src/store/checkoutStore';
|
||||||
import { clearLocalCart } from '@/hooks/cart-query-hooks';
|
import { clearLocalCart } from '@/hooks/cart-query-hooks';
|
||||||
import { useQueryClient } from '@tanstack/react-query';
|
import { useQueryClient } from '@tanstack/react-query';
|
||||||
import { FontAwesome5, FontAwesome6 } from '@expo/vector-icons';
|
|
||||||
|
|
||||||
interface PaymentAndOrderProps {
|
interface PaymentAndOrderProps {
|
||||||
selectedAddress: number | null;
|
selectedAddress: number | null;
|
||||||
|
|
@ -216,7 +215,7 @@ const PaymentAndOrderComponent: React.FC<PaymentAndOrderProps> = ({
|
||||||
<View style={tw`w-2.5 h-2.5 rounded-full bg-brand500`} />
|
<View style={tw`w-2.5 h-2.5 rounded-full bg-brand500`} />
|
||||||
</View>
|
</View>
|
||||||
<View style={tw`w-10 h-10 bg-green-50 rounded-full items-center justify-center mr-3`}>
|
<View style={tw`w-10 h-10 bg-green-50 rounded-full items-center justify-center mr-3`}>
|
||||||
<FontAwesome5 name="rupee-sign" size={20} color="#10B981" />
|
<MaterialIcons name="currency-rupee" size={20} color="#10B981" />
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
<MyText style={tw`font-bold text-gray-900`}>Cash on Delivery</MyText>
|
<MyText style={tw`font-bold text-gray-900`}>Cash on Delivery</MyText>
|
||||||
|
|
@ -226,11 +225,11 @@ const PaymentAndOrderComponent: React.FC<PaymentAndOrderProps> = ({
|
||||||
|
|
||||||
<View style={tw`mt-3 flex-row items-center gap-4`}>
|
<View style={tw`mt-3 flex-row items-center gap-4`}>
|
||||||
<View style={tw`flex-row items-center`}>
|
<View style={tw`flex-row items-center`}>
|
||||||
<FontAwesome6 name="wallet" size={12} color="#663399" style={tw`mr-1.5`} />
|
<MaterialIcons name="account-balance-wallet" size={12} color="#663399" style={tw`mr-1.5`} />
|
||||||
<MyText style={tw`text-xs text-gray-500`}>UPI accepted during COD</MyText>
|
<MyText style={tw`text-xs text-gray-500`}>UPI accepted during COD</MyText>
|
||||||
</View>
|
</View>
|
||||||
<View style={tw`flex-row items-center`}>
|
<View style={tw`flex-row items-center`}>
|
||||||
<FontAwesome5 name="money-bill-wave" size={12} color="#10B981" style={tw`mr-1.5`} />
|
<MaterialIcons name="payments" size={12} color="#10B981" style={tw`mr-1.5`} />
|
||||||
<MyText style={tw`text-xs text-gray-500`}>Cash payment</MyText>
|
<MyText style={tw`text-xs text-gray-500`}>Cash payment</MyText>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import usePickImage from 'common-ui/src/components/use-pick-image';
|
||||||
import { theme } from 'common-ui/src/theme';
|
import { theme } from 'common-ui/src/theme';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
import FontAwesome5 from '@expo/vector-icons/FontAwesome5';
|
|
||||||
import { trpc, trpcClient } from '@/src/trpc-client';
|
import { trpc, trpcClient } from '@/src/trpc-client';
|
||||||
import { useAddToCart, useGetCart, useUpdateCartItem, useRemoveFromCart } from '@/hooks/cart-query-hooks';
|
import { useAddToCart, useGetCart, useUpdateCartItem, useRemoveFromCart } from '@/hooks/cart-query-hooks';
|
||||||
import { useProductSlotIdentifier } from '@/hooks/useProductSlotIdentifier';
|
import { useProductSlotIdentifier } from '@/hooks/useProductSlotIdentifier';
|
||||||
|
|
@ -528,7 +527,7 @@ const ProductDetail: React.FC<ProductDetailProps> = ({ productId, isFlashDeliver
|
||||||
{productDetail.store && (
|
{productDetail.store && (
|
||||||
<View style={tw`mt-6 pt-4 border-t border-gray-100 flex-row items-center`}>
|
<View style={tw`mt-6 pt-4 border-t border-gray-100 flex-row items-center`}>
|
||||||
<View style={tw`w-10 h-10 bg-gray-100 rounded-full items-center justify-center mr-3`}>
|
<View style={tw`w-10 h-10 bg-gray-100 rounded-full items-center justify-center mr-3`}>
|
||||||
<FontAwesome5 name="store" size={16} color="#4B5563" />
|
<MaterialIcons name="store" size={16} color="#4B5563" />
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
<MyText style={tw`text-xs text-gray-500 uppercase font-bold`}>Sourced From</MyText>
|
<MyText style={tw`text-xs text-gray-500 uppercase font-bold`}>Sourced From</MyText>
|
||||||
|
|
@ -668,7 +667,7 @@ const ProductDetail: React.FC<ProductDetailProps> = ({ productId, isFlashDeliver
|
||||||
<MyText style={tw`text-gray-300 text-xs mt-1`}>Be the first to share your thoughts!</MyText>
|
<MyText style={tw`text-gray-300 text-xs mt-1`}>Be the first to share your thoughts!</MyText>
|
||||||
</View>
|
</View>
|
||||||
}
|
}
|
||||||
ListFooterComponent={reviewsLoading ? <View style={tw`py-4`}><MyText style={tw`text-center text-gray-400 text-xs`}>Loading more reviews...</MyText></View> : null}
|
ListFooterComponent={reviewsLoading ? <View style={tw`py-4`}><MyText style={tw`text-center text-gray-400 text-xs`}>Loading more reviews...</MyText></View> : undefined}
|
||||||
scrollEnabled={false}
|
scrollEnabled={false}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Drawer } from 'expo-router/drawer';
|
import { Drawer } from 'expo-router/drawer';
|
||||||
import { DrawerContentComponentProps } from '@react-navigation/drawer';
|
|
||||||
import { View, ScrollView, Alert, Dimensions, RefreshControl } from 'react-native';
|
import { View, ScrollView, Alert, Dimensions, RefreshControl } from 'react-native';
|
||||||
import { Image } from 'expo-image';
|
import { Image } from 'expo-image';
|
||||||
import { useRouter, usePathname, Slot } from 'expo-router';
|
import { useRouter, usePathname, Slot } from 'expo-router';
|
||||||
|
|
@ -31,7 +30,9 @@ interface SlotLayoutProps extends SlotProductsProps {
|
||||||
isForFlashDelivery?: boolean;
|
isForFlashDelivery?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
function CustomDrawerContent(baseUrl: string, drawerProps: DrawerContentComponentProps, slotIdParent?: number, storeIdParent?: number) {
|
type DrawerContentProps = Parameters<NonNullable<React.ComponentProps<typeof Drawer>['drawerContent']>>[0];
|
||||||
|
|
||||||
|
function CustomDrawerContent(baseUrl: string, drawerProps: DrawerContentProps, slotIdParent?: number, storeIdParent?: number) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const { data: storesData } = useStores();
|
const { data: storesData } = useStores();
|
||||||
|
|
@ -536,7 +537,7 @@ export function SlotProducts({ slotId:slotIdParent, storeId:storeIdParent, baseU
|
||||||
<View style={tw`items-center justify-center py-10`}>
|
<View style={tw`items-center justify-center py-10`}>
|
||||||
<MyText style={tw`text-gray-400 font-medium`}>No products from this store in this slot.</MyText>
|
<MyText style={tw`text-gray-400 font-medium`}>No products from this store in this slot.</MyText>
|
||||||
</View>
|
</View>
|
||||||
) : null
|
) : undefined
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -426,7 +426,9 @@ function RegistrationForm({ onSubmit, isLoading = false, initialValues, isEdit =
|
||||||
|
|
||||||
<MyButton
|
<MyButton
|
||||||
testID="registration-submit-button"
|
testID="registration-submit-button"
|
||||||
onPress={handleSubmit(handleFormSubmit)}
|
onPress={() => {
|
||||||
|
void handleSubmit(handleFormSubmit)();
|
||||||
|
}}
|
||||||
fillColor="brand500"
|
fillColor="brand500"
|
||||||
textColor="white1"
|
textColor="white1"
|
||||||
fullWidth
|
fullWidth
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { useFocusEffect } from '@react-navigation/native';
|
|
||||||
import type { AuthRedirectOptions } from '@packages/shared'
|
import type { AuthRedirectOptions } from '@packages/shared'
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter, useFocusEffect } from 'expo-router';
|
||||||
import { useAuth } from '@/src/contexts/AuthContext';
|
import { useAuth } from '@/src/contexts/AuthContext';
|
||||||
import type { RedirectState } from '@/src/contexts/AuthContext';
|
import type { RedirectState } from '@/src/contexts/AuthContext';
|
||||||
import { StorageServiceCasual } from 'common-ui';
|
import { StorageServiceCasual } from 'common-ui';
|
||||||
|
|
|
||||||
|
|
@ -30,4 +30,19 @@ config.resolver.blockList = [
|
||||||
new RegExp(`^${escapeForRegExp(path.resolve(__dirname, 'tests'))}[/\\\\].*$`),
|
new RegExp(`^${escapeForRegExp(path.resolve(__dirname, 'tests'))}[/\\\\].*$`),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// expo-router's public entry requires `withLayoutContext` -> NativeTabTrigger
|
||||||
|
// -> optional-libraries/expo-symbols, which does `require('expo-symbols')` at
|
||||||
|
// module scope. That drags @expo-google-fonts/material-symbols (976 KB) into
|
||||||
|
// every bundle for a native-tabs feature this app never uses. Nothing imports
|
||||||
|
// expo-symbols directly, so resolve it to an empty module.
|
||||||
|
const upstreamResolveRequest = config.resolver.resolveRequest;
|
||||||
|
config.resolver.resolveRequest = (context, moduleName, platform) => {
|
||||||
|
if (moduleName === 'expo-symbols') {
|
||||||
|
return { type: 'empty' };
|
||||||
|
}
|
||||||
|
return upstreamResolveRequest
|
||||||
|
? upstreamResolveRequest(context, moduleName, platform)
|
||||||
|
: context.resolveRequest(context, moduleName, platform);
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
|
|
||||||
|
|
@ -14,77 +14,87 @@
|
||||||
"test:typecheck": "tsc --noEmit --project tsconfig.json"
|
"test:typecheck": "tsc --noEmit --project tsconfig.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/vector-icons": "^14.1.0",
|
"@expo/vector-icons": "^15.0.2",
|
||||||
"@react-native-community/datetimepicker": "8.4.1",
|
"@react-native-async-storage/async-storage": "2.2.0",
|
||||||
"@react-native-google-signin/google-signin": "^16.0.0",
|
"@react-native-community/datetimepicker": "9.2.1",
|
||||||
"@react-native-picker/picker": "2.11.1",
|
"@react-native-community/netinfo": "12.0.1",
|
||||||
"@react-navigation/bottom-tabs": "^7.3.10",
|
"@react-native-community/slider": "5.2.1",
|
||||||
"@react-navigation/drawer": "^7.3.9",
|
"@react-navigation/drawer": "^7.3.9",
|
||||||
"@react-navigation/elements": "^2.3.8",
|
|
||||||
"@react-navigation/native": "^7.1.6",
|
"@react-navigation/native": "^7.1.6",
|
||||||
|
"@shopify/flash-list": "2.3.2",
|
||||||
"@tanstack/react-query": "^5.100.0",
|
"@tanstack/react-query": "^5.100.0",
|
||||||
"@trpc/client": "^11.6.0",
|
"@trpc/client": "^11.6.0",
|
||||||
"@trpc/react-query": "^11.6.0",
|
"@trpc/react-query": "^11.6.0",
|
||||||
"axios": "^1.11.0",
|
"axios": "^1.11.0",
|
||||||
"dayjs": "^1.11.18",
|
"dayjs": "^1.11.18",
|
||||||
"expo": "~53.0.22",
|
"expo": "~58.0.26",
|
||||||
"expo-blur": "~14.1.5",
|
"expo-application": "~58.1.2",
|
||||||
"expo-constants": "~17.1.7",
|
"expo-blur": "~58.0.6",
|
||||||
"expo-crypto": "~14.1.5",
|
"expo-camera": "~58.0.14",
|
||||||
"expo-device": "~7.1.4",
|
"expo-clipboard": "~58.0.4",
|
||||||
"expo-document-picker": "~13.1.6",
|
"expo-constants": "~58.0.16",
|
||||||
"expo-font": "~13.3.2",
|
"expo-crypto": "~58.0.8",
|
||||||
"expo-haptics": "~14.1.4",
|
"expo-device": "~58.0.5",
|
||||||
"expo-image": "2.4.1",
|
"expo-document-picker": "~58.0.5",
|
||||||
"expo-image-picker": "~16.1.4",
|
"expo-font": "~58.0.12",
|
||||||
"expo-linear-gradient": "~14.1.5",
|
"expo-haptics": "~58.0.8",
|
||||||
"expo-linking": "~7.1.7",
|
"expo-image": "~58.0.18",
|
||||||
"expo-location": "~18.1.6",
|
"expo-image-picker": "~58.0.10",
|
||||||
"expo-notifications": "~0.31.4",
|
"expo-linear-gradient": "~58.0.4",
|
||||||
"expo-router": "~5.1.5",
|
"expo-linking": "~58.0.17",
|
||||||
"expo-secure-store": "~14.2.4",
|
"expo-location": "~58.0.22",
|
||||||
"expo-splash-screen": "~0.30.10",
|
"expo-notifications": "~58.1.9",
|
||||||
"expo-status-bar": "~2.2.3",
|
"expo-print": "~58.0.9",
|
||||||
"expo-symbols": "~0.4.5",
|
"expo-router": "~58.0.32",
|
||||||
"expo-system-ui": "~5.0.11",
|
"expo-screen-capture": "~58.0.6",
|
||||||
"expo-updates": "~0.28.17",
|
"expo-screen-orientation": "~58.0.4",
|
||||||
"expo-web-browser": "~14.2.0",
|
"expo-secure-store": "~58.0.3",
|
||||||
|
"expo-sharing": "~58.0.23",
|
||||||
|
"expo-splash-screen": "~58.0.14",
|
||||||
|
"expo-sqlite": "~58.0.18",
|
||||||
|
"expo-status-bar": "~58.0.5",
|
||||||
|
"expo-store-review": "~58.0.3",
|
||||||
|
"expo-symbols": "~58.0.5",
|
||||||
|
"expo-system-ui": "~58.0.7",
|
||||||
|
"expo-updates": "~58.0.22",
|
||||||
|
"expo-video": "~58.0.14",
|
||||||
|
"expo-web-browser": "~58.1.0",
|
||||||
"formik": "^2.4.6",
|
"formik": "^2.4.6",
|
||||||
"fuse.js": "^7.1.0",
|
"fuse.js": "^7.1.0",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"react": "19.0.0",
|
"react": "19.3.0",
|
||||||
"react-dom": "19.0.0",
|
"react-dom": "19.3.0",
|
||||||
"react-hook-form": "^7.62.0",
|
"react-hook-form": "^7.62.0",
|
||||||
"react-native": "0.79.6",
|
"react-native": "0.88.1",
|
||||||
"react-native-element-dropdown": "^2.12.4",
|
"react-native-gesture-handler": "~3.3.0",
|
||||||
"react-native-gesture-handler": "~2.24.0",
|
"react-native-keyboard-controller": "1.22.7",
|
||||||
"react-native-pager-view": "6.7.1",
|
"react-native-maps": "1.29.11",
|
||||||
|
"react-native-pager-view": "9.0.7",
|
||||||
"react-native-paper": "^5.14.5",
|
"react-native-paper": "^5.14.5",
|
||||||
"react-native-razorpay": "^2.3.1",
|
"react-native-reanimated": "4.7.1",
|
||||||
"react-native-reanimated": "~3.17.4",
|
"react-native-safe-area-context": "~5.11.1",
|
||||||
"react-native-safe-area-context": "5.4.0",
|
"react-native-screens": "~4.30.1",
|
||||||
"react-native-screens": "~4.11.1",
|
"react-native-svg": "15.16.0",
|
||||||
"react-native-svg": "15.11.2",
|
|
||||||
"react-native-tab-view": "^4.1.3",
|
|
||||||
"react-native-toast-message": "^2.3.3",
|
"react-native-toast-message": "^2.3.3",
|
||||||
"react-native-web": "~0.20.0",
|
"react-native-view-shot": "6.1.1",
|
||||||
"react-native-webview": "13.13.5",
|
"react-native-web": "~0.21.4",
|
||||||
|
"react-native-webview": "14.0.1",
|
||||||
|
"react-native-worklets": "0.13.0",
|
||||||
"twrnc": "^4.9.1",
|
"twrnc": "^4.9.1",
|
||||||
"yup": "^1.7.0"
|
"yup": "^1.7.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.25.2",
|
"@babel/core": "^7.29.7",
|
||||||
"@testing-library/react-native": "^13",
|
"@testing-library/react-native": "^13",
|
||||||
"@types/jest": "^29",
|
"@types/jest": "30.0.0",
|
||||||
"@types/react": "~19.0.10",
|
"@types/react": "~19.3.0",
|
||||||
"@types/react-native-razorpay": "^2.2.6",
|
"babel-preset-expo": "~58.0.26",
|
||||||
"babel-preset-expo": "~13.0.0",
|
|
||||||
"eslint": "^9.25.0",
|
"eslint": "^9.25.0",
|
||||||
"eslint-config-expo": "~9.2.0",
|
"eslint-config-expo": "~58.0.4",
|
||||||
"jest": "~29.7.0",
|
"jest": "~30.5.2",
|
||||||
"jest-expo": "~53.0.0",
|
"jest-expo": "~58.0.15",
|
||||||
"react-test-renderer": "19.0.0",
|
"react-test-renderer": "19.0.0",
|
||||||
"typescript": "~5.8.3"
|
"typescript": "~6.0.3"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,14 +89,8 @@ export const NotificationProvider: React.FC<ReactParentComponent> = ({
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
if (notificationListener.current) {
|
notificationListener.current?.remove();
|
||||||
Notifications.removeNotificationSubscription(
|
responseListener.current?.remove();
|
||||||
notificationListener.current
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (responseListener.current) {
|
|
||||||
Notifications.removeNotificationSubscription(responseListener.current);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { useFocusEffect } from '@react-navigation/native';
|
import { useFocusEffect } from 'expo-router';
|
||||||
import { useAppStore } from '@/src/store/appStore';
|
import { useAppStore } from '@/src/store/appStore';
|
||||||
|
|
||||||
export const useHideTabNav = (caller: string = 'default') => {
|
export const useHideTabNav = (caller: string = 'default') => {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import * as FileSystem from 'expo-file-system'
|
import * as FileSystem from 'expo-file-system/legacy'
|
||||||
import { IMAGE_CACHE_CLEARED_AT_KEY } from '@/src/lib/image-cache-ttl'
|
import { IMAGE_CACHE_CLEARED_AT_KEY } from '@/src/lib/image-cache-ttl'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ describe('app entry + route layouts (APP-01..APP-24)', () => {
|
||||||
.UNSAFE_getAllByType(Tabs.Screen)
|
.UNSAFE_getAllByType(Tabs.Screen)
|
||||||
.find((screen: any) => screen.props.name === '(tabs)/flash-delivery')
|
.find((screen: any) => screen.props.name === '(tabs)/flash-delivery')
|
||||||
const button = render(
|
const button = render(
|
||||||
center.props.options.tabBarButton({ style: {}, accessibilityState: { selected: true } })
|
center!.props.options.tabBarButton({ style: {}, accessibilityState: { selected: true } })
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(button.getByText('1 Hr Delivery')).toBeTruthy()
|
expect(button.getByText('1 Hr Delivery')).toBeTruthy()
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ describe('Complaints (CMP-01..CMP-18)', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
resetAllMocks()
|
resetAllMocks()
|
||||||
mockFocusCallbacks.clear()
|
mockFocusCallbacks.clear()
|
||||||
jest.spyOn(Linking, 'openURL').mockResolvedValue(true)
|
jest.spyOn(Linking, 'openURL').mockResolvedValue(undefined as any)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('CMP-01: shows loading copy while the complaints query is pending', () => {
|
it('CMP-01: shows loading copy while the complaints query is pending', () => {
|
||||||
|
|
|
||||||
|
|
@ -1568,7 +1568,7 @@ describe('Home (HOME)', () => {
|
||||||
it('HOME-110: the support mobile renders and tapping it opens a tel: link', async () => {
|
it('HOME-110: the support mobile renders and tapping it opens a tel: link', async () => {
|
||||||
signedIn()
|
signedIn()
|
||||||
setOrders([{ ...O1, deliveryStatus: 'processing' }])
|
setOrders([{ ...O1, deliveryStatus: 'processing' }])
|
||||||
const openURL = jest.spyOn(Linking, 'openURL').mockResolvedValue(true)
|
const openURL = jest.spyOn(Linking, 'openURL').mockResolvedValue(undefined as any)
|
||||||
const { getByText, getByTestId } = await renderHome()
|
const { getByText, getByTestId } = await renderHome()
|
||||||
|
|
||||||
expect(getByText('Need help? Call 8688182552')).toBeTruthy()
|
expect(getByText('Need help? Call 8688182552')).toBeTruthy()
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ describe('Me layout (APP-20..APP-23 / ME-20)', () => {
|
||||||
(screen: any) => screen.props.name === '[id]'
|
(screen: any) => screen.props.name === '[id]'
|
||||||
)
|
)
|
||||||
expect(stack.props.screenOptions.title).toBe('My Orders')
|
expect(stack.props.screenOptions.title).toBe('My Orders')
|
||||||
expect(detail.props.options.title).toBe('Order Details')
|
expect(detail!.props.options.title).toBe('Order Details')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('ME-20: signed out the me layout gates the hub behind the login wall', () => {
|
it('ME-20: signed out the me layout gates the hub behind the login wall', () => {
|
||||||
|
|
|
||||||
10
apps/user-ui/tests/types/jest-globals.d.ts
vendored
Normal file
10
apps/user-ui/tests/types/jest-globals.d.ts
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
/**
|
||||||
|
* jest 30's @types/jest no longer declares the global `jest` object — it moved
|
||||||
|
* to `@jest/globals`. The suites still use `jest.fn()`, `jest.mock()`, etc. as
|
||||||
|
* globals, so re-declare it here instead of importing it in ~70 files.
|
||||||
|
*/
|
||||||
|
declare global {
|
||||||
|
const jest: typeof import('@jest/globals').jest
|
||||||
|
}
|
||||||
|
|
||||||
|
export {}
|
||||||
|
|
@ -39,7 +39,11 @@
|
||||||
".web",
|
".web",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
"jsx": "react-native"
|
"jsx": "react-native",
|
||||||
|
"types": [
|
||||||
|
"jest",
|
||||||
|
"node"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -6,10 +6,12 @@
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"build:dev": "CLOUDFLARE_ENV=dev vite build",
|
"build:dev": "CLOUDFLARE_ENV=dev vite build",
|
||||||
|
"build:app": "CLOUDFLARE_ENV=app vite build",
|
||||||
"preview": "npm run build && wrangler dev",
|
"preview": "npm run build && wrangler dev",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"deploy": "npm run build && wrangler deploy",
|
"deploy": "npm run build && wrangler deploy",
|
||||||
"deploy:dev": "npm run build:dev && wrangler deploy",
|
"deploy:dev": "npm run build:dev && wrangler deploy",
|
||||||
|
"deploy:app": "npm run build:app && wrangler deploy",
|
||||||
"cf-typegen": "wrangler types"
|
"cf-typegen": "wrangler types"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
10
apps/web-ui/public/.well-known/assetlinks.json
Normal file
10
apps/web-ui/public/.well-known/assetlinks.json
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"relation": ["delegate_permission/common.handle_all_urls"],
|
||||||
|
"target": {
|
||||||
|
"namespace": "android_app",
|
||||||
|
"package_name": "in.freshyo.app",
|
||||||
|
"sha256_cert_fingerprints": ["05:9E:E6:A4:37:42:E4:B2:2C:DD:EC:4A:98:54:E3:F7:CF:0A:5F:EF:4D:A7:C7:FD:B5:59:AB:E9:EF:96:34:4B"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
41
apps/web-ui/src/lib/well-known.ts
Normal file
41
apps/web-ui/src/lib/well-known.ts
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
/**
|
||||||
|
* Domain-association documents served at /.well-known/*.
|
||||||
|
*
|
||||||
|
* The file is per-host: iOS reads the AASA from the host being opened, and the
|
||||||
|
* `components` list decides which paths on *that* host may open the app. It
|
||||||
|
* cannot be a static asset because every deploy target of this app (www,
|
||||||
|
* app.freshyo.in, devwebui) shares the same `public/` folder.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Apple Team ID + bundle id of the mobile app (apps/user-ui/app.json). */
|
||||||
|
const APP_ID = 'YG52TAX22H.com.freshyotrial.app'
|
||||||
|
|
||||||
|
/** Hosts that claim the whole domain, everything else is treated the same. */
|
||||||
|
const WWW_HOST = 'www.freshyo.in'
|
||||||
|
|
||||||
|
export type AppleAppSiteAssociation = {
|
||||||
|
applinks: {
|
||||||
|
apps: string[]
|
||||||
|
details: Array<{
|
||||||
|
appID: string
|
||||||
|
components: Array<{ '/'?: string; exclude?: boolean }>
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function aasaFor(hostname: string): AppleAppSiteAssociation {
|
||||||
|
// www only claims /mobileoffers/*; app.freshyo.in (and any other host that
|
||||||
|
// serves this file) claims the whole domain. Keep in sync with the
|
||||||
|
// intentFilters in apps/user-ui/app.json.
|
||||||
|
const components =
|
||||||
|
hostname === WWW_HOST
|
||||||
|
? [{ '/': '/mobileoffers/*' }]
|
||||||
|
: [{ '/': '/*' }]
|
||||||
|
|
||||||
|
return {
|
||||||
|
applinks: {
|
||||||
|
apps: [],
|
||||||
|
details: [{ appID: APP_ID, components }],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
36
apps/web-ui/src/server-entry.ts
Normal file
36
apps/web-ui/src/server-entry.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
import entry from '@tanstack/react-start/server-entry'
|
||||||
|
|
||||||
|
import { aasaFor } from './lib/well-known'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apple App Site Association path. Android's Digital Asset Links file stays a
|
||||||
|
* static asset (`public/.well-known/assetlinks.json`) because it is identical
|
||||||
|
* on every host; only the AASA depends on the domain being opened.
|
||||||
|
*/
|
||||||
|
const AASA_PATH = '/.well-known/apple-app-site-association'
|
||||||
|
|
||||||
|
type WorkerFetch = (request: Request, ...rest: unknown[]) => Promise<Response>
|
||||||
|
|
||||||
|
function json(body: unknown): Response {
|
||||||
|
return new Response(JSON.stringify(body, null, 2), {
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
// Short cache: Apple's CDN re-reads the file, and we want the ability to
|
||||||
|
// correct a bad component list without waiting a day.
|
||||||
|
'cache-control': 'public, max-age=300',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
fetch(request: Request, ...rest: unknown[]): Response | Promise<Response> {
|
||||||
|
const { pathname, hostname } = new URL(request.url)
|
||||||
|
|
||||||
|
if (pathname === AASA_PATH) {
|
||||||
|
return json(aasaFor(hostname))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Everything else is the normal TanStack Start app.
|
||||||
|
return (entry.fetch as unknown as WorkerFetch)(request, ...rest)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"observability": {
|
"observability": {
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
"main": "@tanstack/react-start/server-entry",
|
"main": "./src/server-entry.ts",
|
||||||
"compatibility_flags": [
|
"compatibility_flags": [
|
||||||
"nodejs_compat"
|
"nodejs_compat"
|
||||||
],
|
],
|
||||||
|
|
@ -22,6 +22,18 @@
|
||||||
"custom_domain": true
|
"custom_domain": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
// Mobile-app host: serves app.freshyo.in, including its own
|
||||||
|
// /.well-known/* association files (Android App Links + iOS AASA).
|
||||||
|
// Build with CLOUDFLARE_ENV=app (`npm run deploy:app`).
|
||||||
|
"app": {
|
||||||
|
"name": "web-ui-app",
|
||||||
|
"routes": [
|
||||||
|
{
|
||||||
|
"pattern": "app.freshyo.in",
|
||||||
|
"custom_domain": true
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
503
change-log.txt
503
change-log.txt
|
|
@ -1508,3 +1508,506 @@ case and smaller so it fits beside the 2xl figure).
|
||||||
(testID cart-item-coupon-price-{id})
|
(testID cart-item-coupon-price-{id})
|
||||||
- footer: standalone hint block under the subtotal row
|
- footer: standalone hint block under the subtotal row
|
||||||
+ hint inline with ₹subtotal (testID apply-coupons-hint, numberOfLines 1)
|
+ hint inline with ₹subtotal (testID apply-coupons-hint, numberOfLines 1)
|
||||||
|
|
||||||
|
[2026-11-17 08:33:07 IST] user-ui: drop dependencies nothing imports.
|
||||||
|
|
||||||
|
Every removed entry was checked against real import/require statements in
|
||||||
|
apps/user-ui and packages/ui (no docs/mentions counted). Everything kept is
|
||||||
|
still installed through another workspace package or required by app.json /
|
||||||
|
Expo tooling, so this only shrinks the manifest - not the hoisted install.
|
||||||
|
|
||||||
|
--- apps/user-ui/package.json (dependencies)
|
||||||
|
- @react-native-google-signin/google-signin: 0 imports repo-wide
|
||||||
|
- @react-native-picker/picker: 0 imports
|
||||||
|
- @react-navigation/bottom-tabs: 0 imports (expo-router depends on it)
|
||||||
|
- @react-navigation/elements: 0 imports (@react-navigation/drawer depends on it)
|
||||||
|
- expo-haptics: 0 imports
|
||||||
|
- expo-symbols: 0 imports
|
||||||
|
- react-native-element-dropdown: only packages/ui (dropdown/multi-select)
|
||||||
|
- react-native-pager-view: 0 direct imports
|
||||||
|
- react-native-tab-view: only apps/admin-ui
|
||||||
|
- react-native-razorpay: 0 imports (checkout uses PhonePe)
|
||||||
|
- @react-native-community/datetimepicker: only packages/ui (date pickers)
|
||||||
|
--- apps/user-ui/package.json (devDependencies)
|
||||||
|
- @types/react-native-razorpay: only typed the removed razorpay package
|
||||||
|
|
||||||
|
Kept despite being imported only by packages/ui: expo-blur, expo-document-picker,
|
||||||
|
expo-status-bar, expo-crypto, expo-web-browser, twrnc.
|
||||||
|
Kept despite 0 direct imports: expo-secure-store / expo-splash-screen (app.json
|
||||||
|
plugins), expo-system-ui (userInterfaceStyle), react-native-screens (expo-router
|
||||||
|
peer), react-native-web + react-dom (web bundler).
|
||||||
|
|
||||||
|
[2026-11-17 08:34:11 IST] user-ui: add @react-native-async-storage/async-storage 2.1.2.
|
||||||
|
|
||||||
|
Expo's bundledNativeModules for SDK 53 pins 2.1.2, so it is installed exact
|
||||||
|
(no caret) to keep `npx expo install --check` quiet and the native module in
|
||||||
|
step with the SDK. Installed with bun so the workspace lockfile stays the
|
||||||
|
source of truth.
|
||||||
|
|
||||||
|
--- apps/user-ui/package.json (dependencies)
|
||||||
|
+ "@react-native-async-storage/async-storage": "2.1.2"
|
||||||
|
|
||||||
|
[2026-11-17 23:09:20 IST] user-ui app.json: claim two link surfaces for the app.
|
||||||
|
|
||||||
|
--- apps/user-ui/app.json (ios)
|
||||||
|
+ "associatedDomains": ["applinks:www.freshyo.in", "applinks:app.freshyo.in"]
|
||||||
|
--- apps/user-ui/app.json (android)
|
||||||
|
+ "intentFilters": one autoVerify VIEW filter with two https data entries:
|
||||||
|
+ www.freshyo.in pathPrefix "/mobileoffers/"
|
||||||
|
+ app.freshyo.in pathPrefix "/"
|
||||||
|
|
||||||
|
[2026-11-17 23:11:26 IST] web-ui: add the domain-association files with placeholders.
|
||||||
|
|
||||||
|
Static files under public/ are copied verbatim by Vite into dist/client, so both
|
||||||
|
are served at the site root. Values that only the Apple/Play accounts can
|
||||||
|
provide are left as REPLACE_WITH_* tokens.
|
||||||
|
|
||||||
|
--- apps/web-ui/public/.well-known/apple-app-site-association (new)
|
||||||
|
iOS AASA for www.freshyo.in; components restricted to /mobileoffers/*
|
||||||
|
(app.freshyo.in needs its own copy claiming /* and must be served by that host)
|
||||||
|
--- apps/web-ui/public/.well-known/assetlinks.json (new)
|
||||||
|
Android Digital Asset Links for in.freshyo.app; SHA-256 fingerprint placeholder
|
||||||
|
|
||||||
|
[2026-11-17 23:16:23 IST] web-ui: fill the Android signing fingerprint in assetlinks.json.
|
||||||
|
|
||||||
|
--- apps/web-ui/public/.well-known/assetlinks.json
|
||||||
|
- "sha256_cert_fingerprints": ["REPLACE_WITH_SHA256_CERT_FINGERPRINT"]
|
||||||
|
+ "sha256_cert_fingerprints": ["05:9E:E6:A4:37:42:E4:B2:2C:DD:EC:4A:98:54:E3:F7:CF:0A:5F:EF:4D:A7:C7:FD:B5:59:AB:E9:EF:96:34:4B"]
|
||||||
|
|
||||||
|
[2026-11-17 23:17:24 IST] web-ui: fill the Apple Team ID in the AASA.
|
||||||
|
|
||||||
|
--- apps/web-ui/public/.well-known/apple-app-site-association
|
||||||
|
- "appID": "REPLACE_WITH_APPLE_TEAM_ID.com.freshyotrial.app"
|
||||||
|
+ "appID": "YG52TAX22H.com.freshyotrial.app"
|
||||||
|
|
||||||
|
[2026-11-18 00:14:23 IST] common-ui: stop the barrel from eagerly pulling native modules.
|
||||||
|
|
||||||
|
The app crashed on launch with "TurboModuleRegistry.getEnforcing(...):
|
||||||
|
'RNCDatePicker' could not be found" because `import { ... } from 'common-ui'`
|
||||||
|
evaluated packages/ui/index.ts, which statically imported the date pickers, and
|
||||||
|
@react-native-community/datetimepicker resolves its native module at import time.
|
||||||
|
Nothing in user-ui renders a picker; the import alone was enough.
|
||||||
|
|
||||||
|
--- packages/ui/index.ts
|
||||||
|
- import DatePicker from "./src/components/date-picker" (dead: 0 consumers)
|
||||||
|
- import DateTimePickerMod from "./src/components/date-time-picker" (kept, but no
|
||||||
|
longer re-exported - only admin-ui uses it, via a deep import like SlotForm.tsx)
|
||||||
|
- dropped both from the export block
|
||||||
|
|
||||||
|
--- packages/ui/src/components/date-picker.tsx (deleted, 99 lines, 0 importers)
|
||||||
|
--- packages/ui/src/components/dropdown.tsx (deleted, 85 lines, 0 importers)
|
||||||
|
--- packages/ui/src/components/multi-select.tsx (deleted, 118 lines, 0 importers)
|
||||||
|
|
||||||
|
--- packages/ui/src/components/bottom-dropdown.tsx
|
||||||
|
+ inlined DropdownBaseProps (was imported as a type from the deleted dropdown.tsx)
|
||||||
|
|
||||||
|
--- packages/ui/package.json
|
||||||
|
- react-native-element-dropdown (only the two deleted components used it)
|
||||||
|
- expo-haptics, expo-symbols, @react-native-picker/picker, react-native-pager-view,
|
||||||
|
react-native-tab-view, react-native-razorpay, @react-native-google-signin/google-signin,
|
||||||
|
@react-navigation/bottom-tabs, @react-navigation/elements (0 references in packages/ui)
|
||||||
|
kept: @react-native-community/datetimepicker (date-time-picker.tsx needs it)
|
||||||
|
--- apps/admin-ui/src/components/CouponForm.tsx
|
||||||
|
- DateTimePickerMod from 'common-ui'
|
||||||
|
+ DateTimePickerMod from 'common-ui/src/components/date-time-picker'
|
||||||
|
--- apps/admin-ui/tests/components/coupon-form.test.tsx (same import switch)
|
||||||
|
|
||||||
|
[2026-11-18 00:25:23 IST] user-ui app.json: split the App Links filter per host.
|
||||||
|
|
||||||
|
Android merges the attributes of every <data> element inside one intent filter,
|
||||||
|
so the single filter (hosts www+app, paths /mobileoffers/ + /) matched the
|
||||||
|
cartesian product: www.freshyo.in/cart opened the app. Two filters now, one per
|
||||||
|
host, so www is restricted to /mobileoffers/ and app.freshyo.in keeps /.
|
||||||
|
|
||||||
|
--- apps/user-ui/app.json (android.intentFilters)
|
||||||
|
- one filter with data: [www + /mobileoffers/, app + /]
|
||||||
|
+ filter 1: www.freshyo.in pathPrefix /mobileoffers/
|
||||||
|
+ filter 2: app.freshyo.in pathPrefix /
|
||||||
|
|
||||||
|
[2026-11-18 00:27:54 IST] admin-ui: drop dependencies nothing imports.
|
||||||
|
|
||||||
|
Same audit as user-ui: every entry below has zero import/require statements in
|
||||||
|
apps/admin-ui, and is not needed by a config plugin, a native autolinking
|
||||||
|
target, or a peer of expo-router / react-native-tab-view.
|
||||||
|
|
||||||
|
--- apps/admin-ui/package.json (dependencies)
|
||||||
|
- @react-native-picker/picker (0 refs; no component uses it)
|
||||||
|
- @react-navigation/bottom-tabs (0 refs; expo-router depends on it)
|
||||||
|
- @react-navigation/elements (0 refs; @react-navigation/drawer depends on it)
|
||||||
|
- @react-navigation/material-top-tabs (0 refs; TabView comes from react-native-tab-view)
|
||||||
|
- axios (0 refs; only packages/ui/src/services/axios.ts
|
||||||
|
uses it and nothing imports that file)
|
||||||
|
- buffer (0 refs; Buffer only used as a Node global in tests)
|
||||||
|
- expo-haptics (0 refs)
|
||||||
|
- expo-symbols (0 refs)
|
||||||
|
- expo-web-browser (0 refs; only packages/ui/google-sign-in.tsx,
|
||||||
|
which admin-ui never imports)
|
||||||
|
- jwt-decode (0 refs)
|
||||||
|
- react-hook-form (0 refs; forms use formik + yup)
|
||||||
|
- react-native-element-dropdown (0 refs; its common-ui consumers were deleted)
|
||||||
|
- react-native-webview (0 refs)
|
||||||
|
|
||||||
|
Kept on purpose: @react-native-community/datetimepicker (CouponForm/SlotForm
|
||||||
|
deep-import the common-ui date-time-picker), react-native-pager-view (native
|
||||||
|
partner of the used react-native-tab-view), react-native-screens / expo-linking /
|
||||||
|
expo-constants / expo-font (expo-router + vector-icons), expo-updates (app.json
|
||||||
|
updates.url), expo-system-ui (userInterfaceStyle), expo-splash-screen /
|
||||||
|
expo-secure-store (app.json plugins), react-dom + react-native-web ("web" script
|
||||||
|
and app.json web output), expo-document-picker + expo-status-bar (common-ui
|
||||||
|
components admin-ui renders).
|
||||||
|
|
||||||
|
[2026-11-18 00:33:51 IST] web-ui: add an "app" deploy target for app.freshyo.in.
|
||||||
|
|
||||||
|
--- apps/web-ui/package.json (scripts)
|
||||||
|
+ "build:app": "CLOUDFLARE_ENV=app vite build"
|
||||||
|
+ "deploy:app": "npm run build:app && wrangler deploy"
|
||||||
|
--- apps/web-ui/wrangler.jsonc (env)
|
||||||
|
+ "app": { "name": "web-ui-app", "routes": [{ "pattern": "app.freshyo.in",
|
||||||
|
"custom_domain": true }] }
|
||||||
|
same shape as env.dev: separate Worker, own custom domain, routes kept out of
|
||||||
|
the top-level so prod/dev/app never claim each other's host.
|
||||||
|
|
||||||
|
[2026-11-18 00:36:12 IST] web-ui: serve the AASA per host from the worker entry.
|
||||||
|
|
||||||
|
The association file is per-host, but public/ is shared by every deploy target,
|
||||||
|
so app.freshyo.in would have served the www variant (/mobileoffers/* only).
|
||||||
|
The file is now generated by a thin worker entry that switches on the request
|
||||||
|
host; assetlinks.json stays static (it is host-agnostic).
|
||||||
|
|
||||||
|
--- apps/web-ui/src/lib/well-known.ts (new)
|
||||||
|
aasaFor(hostname): www.freshyo.in -> /mobileoffers/*, everything else -> /*
|
||||||
|
--- apps/web-ui/src/server-entry.ts (new)
|
||||||
|
intercepts /.well-known/apple-app-site-association, delegates everything else
|
||||||
|
to @tanstack/react-start/server-entry
|
||||||
|
--- apps/web-ui/wrangler.jsonc
|
||||||
|
- "main": "@tanstack/react-start/server-entry"
|
||||||
|
+ "main": "./src/server-entry.ts"
|
||||||
|
--- apps/web-ui/public/.well-known/apple-app-site-association (deleted)
|
||||||
|
the static file would shadow the worker (assets are served before the worker)
|
||||||
|
|
||||||
|
[2026-11-18 01:43:01 IST] user-ui: add react-native-maps (dependency only).
|
||||||
|
|
||||||
|
Expo SDK 53 pins 1.20.1, installed exact like the other native modules. No
|
||||||
|
imports, screens or config changes - the package is only declared so the next
|
||||||
|
native build links it.
|
||||||
|
|
||||||
|
--- apps/user-ui/package.json (dependencies)
|
||||||
|
+ "react-native-maps": "1.20.1"
|
||||||
|
|
||||||
|
[2026-11-18 01:53:59 IST] expo sdk 53 -> 58 across the monorepo.
|
||||||
|
|
||||||
|
SDK 58 is five majors ahead (53 -> 54 -> 55 -> 56 -> 57 -> 58): react-native
|
||||||
|
0.79.6 -> 0.88.1, react 19.0.0 -> 19.3.0, expo-router 5.1.5 -> 58.0.32,
|
||||||
|
reanimated 3.17 -> 4.7.1 (+ react-native-worklets 0.13), gesture-handler
|
||||||
|
2.24 -> 3.3.0, every expo-* module renumbered to 58.x. All four manifests moved
|
||||||
|
together because bun hoists a single react-native copy.
|
||||||
|
|
||||||
|
--- package.json (root)
|
||||||
|
expo ~58.0.26, react 19.3.0, react-native 0.88.1, @react-native/virtualized-lists ^0.88.1,
|
||||||
|
expo-auth-session ~58.0.19, expo-crypto ~58.0.8, expo-web-browser ~58.1.0,
|
||||||
|
@babel/core ^7.29.7, typescript ~6.0.3, @types/react ~19.3.0, eslint-config-expo ~58.0.4
|
||||||
|
--- apps/user-ui/package.json
|
||||||
|
expo 58.0.26, expo-router ~58.0.32, expo-* all 58.x, RN 0.88.1, react 19.3.0,
|
||||||
|
react-native-maps 1.20.1 -> 1.29.11, gesture-handler ~3.3.0, reanimated 4.7.1,
|
||||||
|
+ react-native-worklets 0.13.0, screens ~4.30.1, safe-area ~5.11.1, svg 15.16.0,
|
||||||
|
webview 14.0.1, react-native-web ~0.21.4, async-storage 2.2.0,
|
||||||
|
jest ~30.5.2 + @types/jest 30, jest-expo ~58.0.15, typescript ~6.0.3,
|
||||||
|
babel-preset-expo ~58.0.26, eslint-config-expo ~58.0.4
|
||||||
|
--- apps/admin-ui/package.json
|
||||||
|
same set plus datetimepicker 9.2.1, pager-view 9.0.7
|
||||||
|
--- packages/ui/package.json
|
||||||
|
same set (common-ui compiled inside both apps)
|
||||||
|
--- apps/{user-ui,admin-ui}/app.json
|
||||||
|
- "newArchEnabled": true (not a valid field any more; new arch only)
|
||||||
|
- "android.edgeToEdgeEnabled": true (mandatory/default now)
|
||||||
|
--- apps/{user-ui,admin-ui}/tsconfig.json
|
||||||
|
+ "types": ["jest", "node"] (TS 6 no longer auto-includes @types/jest here)
|
||||||
|
--- apps/{user-ui,admin-ui}/tests/types/jest-globals.d.ts (new)
|
||||||
|
re-declares the global `jest` object that @types/jest 30 moved to @jest/globals
|
||||||
|
--- apps/admin-ui/metro.config.js
|
||||||
|
- config.resolver.disableHierarchicalLookup = true
|
||||||
|
(reanimated 4 validates worklets with its nested semver@7 while root has
|
||||||
|
semver@6, so forcing top-level-only lookup broke the export)
|
||||||
|
|
||||||
|
code migrations:
|
||||||
|
--- app/(auth)/login.tsx TextInput refs -> React.ComponentRef<typeof TextInput>; submit handler wrapped
|
||||||
|
--- components/registration-form.tsx submit handler wrapped (onPress expects a gesture event)
|
||||||
|
--- app/(drawer)/_layout.tsx tabBarIcon color is ColorValue -> cast to string
|
||||||
|
--- components/{CheckoutAddressSelector,NextOrderGlimpse}.tsx
|
||||||
|
ScrollView refs -> React.ComponentRef<typeof ScrollView>
|
||||||
|
--- app/(drawer)/(tabs)/stores/index.tsx, components/ProductDetail.tsx,
|
||||||
|
components/SlotSpecificView.tsx list slots: null -> undefined (Element | null no longer accepted)
|
||||||
|
--- components/SlotSpecificView.tsx DrawerContentComponentProps derived from expo-router's Drawer
|
||||||
|
(expo-router 58 vendors its own react-navigation types)
|
||||||
|
--- services/notif-service/notif-context.tsx (both apps)
|
||||||
|
- Notifications.removeNotificationSubscription(sub) (removed from the API)
|
||||||
|
+ sub?.remove()
|
||||||
|
--- src/lib/image-cache-meta.ts expo-file-system -> expo-file-system/legacy (same API; new
|
||||||
|
File/Paths API is a follow-up)
|
||||||
|
--- packages/ui/src/components/bottom-dropdown.tsx
|
||||||
|
timer ref -> ReturnType<typeof setTimeout>
|
||||||
|
--- admin-ui: complaints / orders / CouponForm list slots null -> undefined;
|
||||||
|
RefreshControl onRefresh wraps refetch (it returns a QueryObserverResult now);
|
||||||
|
tests updated for the new subscription teardown and non-null finds
|
||||||
|
|
||||||
|
verified: tsc clean in user-ui + admin-ui; expo export (android) builds for both;
|
||||||
|
expo install --check clean; jest configs resolve under jest 30; expo-doctor only
|
||||||
|
reports the pre-existing lock-file / .expo-ignore warnings.
|
||||||
|
|
||||||
|
[2026-11-18 01:58:44 IST] user-ui: bump app version to 1.3.0 for the SDK 58 build.
|
||||||
|
|
||||||
|
runtimeVersion is `policy: appVersion`, and it is still 1.2.0 - the same value
|
||||||
|
the SDK 53 APK shipped with. Publishing an SDK 58 update under 1.2.0 would be
|
||||||
|
delivered to those old binaries, whose native side has no react-native-worklets
|
||||||
|
(reanimated 4) and would crash on launch. Bumping the version gives the new
|
||||||
|
build its own runtimeVersion so OTA traffic cannot cross SDK lines.
|
||||||
|
|
||||||
|
--- apps/user-ui/app.json
|
||||||
|
- "version": "1.2.0"
|
||||||
|
+ "version": "1.3.0"
|
||||||
|
|
||||||
|
[2026-11-18 11:50:10 IST] user-ui: add react-native-pager-view (dependency only).
|
||||||
|
|
||||||
|
Native paging primitive behind the home tag tabs (Android ViewPager2 / iOS
|
||||||
|
UIPageViewController). Expo SDK 58 pins 9.0.7, installed exact to match
|
||||||
|
`bundledNativeModules`. No imports, screens or store changes - the package is
|
||||||
|
declared only so the next native build links it; the later JS wiring can then
|
||||||
|
ship as an OTA update on that build's runtimeVersion.
|
||||||
|
|
||||||
|
--- apps/user-ui/package.json (dependencies)
|
||||||
|
+ "react-native-pager-view": "9.0.7"
|
||||||
|
|
||||||
|
[2026-11-18 12:05:00 IST] user-ui: preinstall the future native surface (list A).
|
||||||
|
|
||||||
|
Everything is declared now so the next build links it and later JS-only work can
|
||||||
|
ship by OTA. No imports anywhere yet.
|
||||||
|
|
||||||
|
--- apps/user-ui/package.json (dependencies, SDK 58 pins)
|
||||||
|
+ @react-native-community/netinfo, expo-clipboard, expo-haptics,
|
||||||
|
+ @react-native-community/slider, react-native-keyboard-controller,
|
||||||
|
+ expo-sharing, react-native-view-shot, expo-print, expo-sqlite,
|
||||||
|
+ expo-camera, expo-local-authentication, expo-media-library, expo-contacts,
|
||||||
|
+ expo-tracking-transparency, @react-native-community/datetimepicker,
|
||||||
|
+ @shopify/flash-list, expo-audio, expo-video, expo-symbols,
|
||||||
|
+ expo-screen-orientation, expo-application, expo-store-review,
|
||||||
|
+ expo-screen-capture
|
||||||
|
--- apps/user-ui/app.json (plugins)
|
||||||
|
+ expo-camera (camera + microphone usage strings, recordAudioAndroid off)
|
||||||
|
+ expo-local-authentication (Face ID usage string)
|
||||||
|
+ expo-media-library (photo library + save permission strings)
|
||||||
|
+ expo-contacts (contacts usage string)
|
||||||
|
+ expo-tracking-transparency (ATT usage string)
|
||||||
|
+ expo-audio (microphone usage string for future voice notes)
|
||||||
|
|
||||||
|
[2026-11-18 12:59:42 IST] user-ui: drop 5 of the preinstalled native modules.
|
||||||
|
|
||||||
|
Keeping the list A set minus the permission-heavy ones: expo-contacts,
|
||||||
|
expo-local-authentication, expo-audio, expo-tracking-transparency and
|
||||||
|
expo-media-library are removed again (package + app.json plugin), so the build
|
||||||
|
carries no mic / contacts / photo-library / ATT / biometrics permissions.
|
||||||
|
|
||||||
|
--- apps/user-ui/package.json (dependencies)
|
||||||
|
- expo-contacts, expo-local-authentication, expo-audio, expo-tracking-transparency,
|
||||||
|
expo-media-library
|
||||||
|
--- apps/user-ui/app.json (plugins)
|
||||||
|
- expo-audio, expo-tracking-transparency, expo-media-library, expo-contacts,
|
||||||
|
expo-local-authentication
|
||||||
|
~ expo-camera: microphonePermission removed; recordAudioAndroid stays false
|
||||||
|
(the plugin defaults it to true, which would add RECORD_AUDIO)
|
||||||
|
|
||||||
|
[2026-11-18 13:12:00 IST] user-ui + common-ui: per-set icon imports, drop MaterialCommunityIcons.
|
||||||
|
|
||||||
|
`from '@expo/vector-icons'` re-exports every icon family, so Metro bundled all
|
||||||
|
18 TTFs (3.93 MB) and their glyphmaps no matter which icon was used. Every barrel
|
||||||
|
import is now the per-set path (`@expo/vector-icons/MaterialIcons`), and the
|
||||||
|
checkbox moved from MaterialCommunityIcons (1.28 MB font + 216 KB glyphmap) to
|
||||||
|
MaterialIcons glyphs, so the user app only ships MaterialIcons, Ionicons and
|
||||||
|
FontAwesome5.
|
||||||
|
|
||||||
|
--- apps/user-ui/** + packages/ui/** (19 files)
|
||||||
|
- import { A, B } from '@expo/vector-icons'
|
||||||
|
+ import A from '@expo/vector-icons/A'
|
||||||
|
+ import B from '@expo/vector-icons/B'
|
||||||
|
--- packages/ui/src/components/checkbox.tsx
|
||||||
|
- MaterialCommunityIcons: checkbox-marked / checkbox-blank-outline /
|
||||||
|
checkbox-marked-circle / checkbox-blank-circle-outline
|
||||||
|
+ MaterialIcons: check-box / check-box-outline-blank / check-circle /
|
||||||
|
radio-button-unchecked
|
||||||
|
|
||||||
|
[2026-11-18 13:26:40 IST] user-ui: drop the remaining unused fonts/icons + dead assets.
|
||||||
|
|
||||||
|
--- apps/user-ui/components/PaymentAndOrderComponent.tsx
|
||||||
|
FontAwesome5 (rupee-sign, money-bill-wave) -> MaterialIcons (currency-rupee, payments)
|
||||||
|
--- apps/user-ui/components/ProductDetail.tsx, stores/store-detail/[id].tsx
|
||||||
|
FontAwesome5 store -> MaterialIcons store
|
||||||
|
(FontAwesome5 pulled Solid+Regular+Brands = 371 KB for three icons)
|
||||||
|
--- apps/user-ui/app/_layout.tsx
|
||||||
|
removed useFonts + the `if (!loaded) return null` gate: only loaded SpaceMono,
|
||||||
|
which no style ever used
|
||||||
|
--- deleted
|
||||||
|
assets/fonts/SpaceMono-Regular.ttf (93 KB, unused)
|
||||||
|
assets/images/logo.png (520 KB, unreferenced;
|
||||||
|
assets/logo.png is the used one)
|
||||||
|
|
||||||
|
measured with `expo export --platform android`:
|
||||||
|
icon fonts 3.93 MB -> 2.05 MB (18 families -> MaterialIcons + Ionicons + Paper's MCI)
|
||||||
|
bundle assets total -> 3.1 MB, hbc 7.0 MB
|
||||||
|
|
||||||
|
[2026-11-18 13:33:10 IST] user-ui: stop bundling expo-symbols / Material Symbols font (976 KB).
|
||||||
|
|
||||||
|
expo-router's public entry eagerly requires `withLayoutContext`, which requires
|
||||||
|
`native-tabs/NativeTabTrigger`, which reaches `optional-libraries/expo-symbols`
|
||||||
|
- and that file does `require('expo-symbols')` at module scope inside a
|
||||||
|
try/catch. Result: every app importing anything from 'expo-router' bundles
|
||||||
|
@expo-google-fonts/material-symbols (976 KB) for a feature we never use
|
||||||
|
(native tabs `md` icons). Swapping expo-router/tabs for
|
||||||
|
@react-navigation/bottom-tabs would not have helped - the chain starts at
|
||||||
|
'expo-router' itself.
|
||||||
|
|
||||||
|
--- apps/user-ui/metro.config.js
|
||||||
|
+ resolver.resolveRequest: `expo-symbols` -> { type: 'empty' }
|
||||||
|
(nothing in the app imports it; only NativeTabs' `md` icon path would, and
|
||||||
|
that now fails with a TypeError instead of a helpful message)
|
||||||
|
|
||||||
|
[2026-11-18 13:41:20 IST] common-ui: remove the Nunito font family entirely.
|
||||||
|
|
||||||
|
MyText mapped every `weight` to a `Nunito-*` family that was never shipped or
|
||||||
|
loaded, so RN silently fell back to the system font on every render - the map
|
||||||
|
was dead config. The family strings (and the dead `fontFamily` variable) are
|
||||||
|
gone; `weight` now only sets `fontWeight`, which is exactly what rendered
|
||||||
|
before, and leaves the door open for Inter later.
|
||||||
|
|
||||||
|
--- packages/ui/src/components/text.tsx
|
||||||
|
- Nunito-Light / Nunito-Regular / Nunito-Medium / Nunito-SemiBold / Nunito-Bold
|
||||||
|
+ FONT_WEIGHTS map: light 300, regular 400, medium 500, semibold 600, bold 700
|
||||||
|
(applies to user-ui and admin-ui, which share this component)
|
||||||
|
|
||||||
|
[2026-11-18 13:25:49 IST] user-ui + admin-ui: Inter as the app font.
|
||||||
|
|
||||||
|
Replaces the dead Nunito map with real Inter files. The family map lives in
|
||||||
|
common-ui so both apps resolve the same six weights; each app loads them with
|
||||||
|
expo-font and keeps its splash up until they are ready.
|
||||||
|
|
||||||
|
--- packages/ui/package.json
|
||||||
|
+ @expo-google-fonts/inter
|
||||||
|
--- packages/ui/src/lib/fonts.ts (new)
|
||||||
|
INTER_FONTS (400/500/600/700/800/900) + interFamilyFor(weight)
|
||||||
|
--- packages/ui/index.ts
|
||||||
|
+ export INTER_FONTS, interFamilyFor
|
||||||
|
--- packages/ui/src/components/text.tsx
|
||||||
|
weight prop + the tw fontWeight in `style` both resolve to an Inter family;
|
||||||
|
fontWeight is dropped from the applied style so Android uses the real file
|
||||||
|
--- apps/user-ui/app/_layout.tsx, apps/admin-ui/app/_layout.tsx
|
||||||
|
useFonts(INTER_FONTS) + SplashScreen.preventAutoHideAsync/hideAsync gate
|
||||||
|
PaperProvider theme fonts mapped per variant weight
|
||||||
|
--- raw <Text> -> MyText
|
||||||
|
apps/user-ui/components/CheckoutAddressSelector.tsx
|
||||||
|
packages/ui/{quantifier,mini-quantifier,bottom-dropdown,date-time-picker}.tsx
|
||||||
|
|
||||||
|
[2026-11-18 13:38:40 IST] user-ui + admin-ui: Inter weights loaded via subpaths (size fix).
|
||||||
|
|
||||||
|
Importing '@expo-google-fonts/inter' from its root pulls every weight *and*
|
||||||
|
italic (18 TTFs, ~6 MB) because the package index re-exports them all and Metro
|
||||||
|
cannot tree-shake asset requires. Each weight is now imported from its own
|
||||||
|
subpath, so exactly the six used files ship (2.06 MB).
|
||||||
|
|
||||||
|
measured: export assets 2.2 MB -> 4.2 MB (fonts +2.06 MB), hbc unchanged ~7 MB
|
||||||
|
|
||||||
|
[2026-11-18 14:04:42 IST] user-ui + admin-ui: navigation hooks come from expo-router.
|
||||||
|
|
||||||
|
Blanking screen after the SDK 58 build: "Couldn't find a navigation object. Is
|
||||||
|
your component inside NavigationContainer?" thrown while rendering Dashboard.
|
||||||
|
expo-router 58 vendors React Navigation, so `useFocusEffect` imported from the
|
||||||
|
standalone @react-navigation/native reads a different context than the one the
|
||||||
|
router provides. Dashboard calls useMarkDataFetchers() -> useFocusEffect, so it
|
||||||
|
threw on first render and the screen stayed blank.
|
||||||
|
|
||||||
|
--- apps/user-ui/{app/_layout.tsx, app/(drawer)/(tabs)/me/index.tsx,
|
||||||
|
app/(drawer)/(tabs)/me/coupons/index.tsx,
|
||||||
|
app/(drawer)/(tabs)/flash-delivery/(products)/index.tsx,
|
||||||
|
hooks/useAuthenticatedRoute.ts, src/hooks/useHideTabNav.ts}
|
||||||
|
--- packages/ui/hooks/{useFocusCallback,useMarkDataFetchers,useDrawerTitle}.ts
|
||||||
|
--- apps/admin-ui/app/(drawer)/dashboard/manage-orders/index.tsx
|
||||||
|
- import { useFocusEffect } from '@react-navigation/native'
|
||||||
|
+ import { useFocusEffect } from 'expo-router'
|
||||||
|
(ThemeProvider/DarkTheme/DefaultTheme in the user-ui root layout likewise)
|
||||||
|
--- apps/admin-ui/app/(drawer)/_layout.tsx
|
||||||
|
- DrawerContentScrollView, DrawerItem from '@react-navigation/drawer'
|
||||||
|
+ from 'expo-router/drawer' (and `color as string` for the 13 DrawerItem icons,
|
||||||
|
the vendored item types color as ColorValue)
|
||||||
|
|
||||||
|
verified: tsc 0 in both apps, expo export builds the android bundle.
|
||||||
|
NOT updated: tests still jest.mock('@react-navigation/native'); those mocks need
|
||||||
|
to point at expo-router when the suites are next touched.
|
||||||
|
|
||||||
|
[2026-11-18 14:45:40 IST] .easignore: stop uploading local artifacts and caches.
|
||||||
|
|
||||||
|
The 151 MB project archive was mostly files no build reads: two APKs in the
|
||||||
|
repo (92 MB + 53 MB), Cloudflare .wrangler state (~46 MB), .opencode tooling
|
||||||
|
(18 MB), backend SQL dumps (18 MB) and .maestro-output (9 MB). All excluded now.
|
||||||
|
|
||||||
|
--- apps/user-ui/.easignore
|
||||||
|
+ *.apk, *.aab, *.ipa, *.hbc, *.hbc.map
|
||||||
|
+ .wrangler/ (any level), .opencode/, .maestro-output/, .playwright-mcp/,
|
||||||
|
.commandcode/, .agents/, react-scan-reports/, address_util/
|
||||||
|
+ *.sqlite, *.sqlite3, apps/backend/dumps/
|
||||||
|
|
||||||
|
[2026-11-18 16:40 IST] App Store screenshots captured from both iOS simulators.
|
||||||
|
|
||||||
|
New files only (no source changed):
|
||||||
|
- apps/user-ui/store-screenshots/iphone-6.9-inch/ (1320x2868, iPhone 16 Pro Max)
|
||||||
|
- apps/user-ui/store-screenshots/iphone-6.5-inch/ (1242x2688, iPhone 6.5")
|
||||||
|
|
||||||
|
Screens: 01-home, 02-one-hour-delivery, 03-stores, 04-my-account
|
||||||
|
(+ 05-product in the 6.9" set; App Store Connect scales the 6.9" set down).
|
||||||
|
|
||||||
|
Status bar was overridden to 9:41 / full wifi / charged for both devices
|
||||||
|
(xcrun simctl status_bar override --time 9:41 ...).
|
||||||
|
|
||||||
|
[2026-11-18 17:01 IST] store-screenshots: strip alpha so App Store Connect accepts them.
|
||||||
|
|
||||||
|
xcrun simctl screenshots are 8-bit RGBA. App Store Connect rejects PNGs with an
|
||||||
|
alpha channel (the validator reports it as a dimensions/size error even though
|
||||||
|
1320x2868 and 1242x2688 were already exact).
|
||||||
|
|
||||||
|
Re-encoded all 9 PNGs in place (CoreGraphics, sRGB, 72 dpi, alpha dropped,
|
||||||
|
pixels otherwise untouched):
|
||||||
|
- apps/user-ui/store-screenshots/iphone-6.9-inch/*.png -> 8-bit/color RGB, hasAlpha: no
|
||||||
|
- apps/user-ui/store-screenshots/iphone-6.5-inch/*.png -> 8-bit/color RGB, hasAlpha: no
|
||||||
|
Also removed the stray .DS_Store files from those folders.
|
||||||
|
|
||||||
|
[2026-11-18 17:04 IST] store-screenshots: add the 6.3" (medium display) set.
|
||||||
|
|
||||||
|
App Store Connect 2026 names the screenshot tabs by device class and sizes are
|
||||||
|
not interchangeable: the tab you land on is "iPhone with Dynamic Island (medium
|
||||||
|
display)" and it only accepts 1179x2556 or 1206x2622, so 1320x2868 / 1242x2688
|
||||||
|
files fail there with a dimensions error even though they are valid elsewhere.
|
||||||
|
|
||||||
|
New: apps/user-ui/store-screenshots/iphone-6.3-inch-medium/*.png
|
||||||
|
Scaled from the 6.9" set with CoreGraphics (high interpolation, sRGB, 72 dpi,
|
||||||
|
no alpha): 1206 x 2622, 8-bit/color RGB, hasAlpha: no.
|
||||||
|
The 6.9" (1320x2868) and 6.5" (1242x2688) sets are unchanged and still valid
|
||||||
|
for the "large display" / "Face ID (large display)" tabs.
|
||||||
|
|
||||||
|
[2026-11-18 18:59:28 IST] user-ui (android): strip the media-read permissions nothing uses.
|
||||||
|
|
||||||
|
READ_MEDIA_IMAGES ships only because expo-screen-capture is installed (its
|
||||||
|
AndroidManifest declares it for API 33); no code imports that module.
|
||||||
|
READ_MEDIA_VIDEO is declared by nothing in node_modules today - blocking it is
|
||||||
|
a guard against a transitive AAR merging it back in.
|
||||||
|
|
||||||
|
Photos are picked with ImagePicker.launchImageLibraryAsync({mediaTypes:['images']}),
|
||||||
|
which uses the Android Photo Picker (no storage permission on 13+), and defect
|
||||||
|
photos come from CameraView (CAMERA only). The legacy READ/WRITE_EXTERNAL_STORAGE
|
||||||
|
pair (maxSdkVersion=32) stays so picking still works on Android <= 12.
|
||||||
|
|
||||||
|
--- apps/user-ui/app.json
|
||||||
|
"android": {
|
||||||
|
+ "blockedPermissions": [
|
||||||
|
+ "android.permission.READ_MEDIA_IMAGES",
|
||||||
|
+ "android.permission.READ_MEDIA_VIDEO"
|
||||||
|
+ ],
|
||||||
|
"softwareKeyboardLayoutMode": "resize",
|
||||||
|
...
|
||||||
|
|
||||||
|
Native change: needs a rebuild; cannot ship over OTA.
|
||||||
|
|
|
||||||
22
package.json
22
package.json
|
|
@ -27,20 +27,20 @@
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.25.2",
|
"@babel/core": "^7.29.7",
|
||||||
"@playwright/test": "^1.63.0",
|
"@playwright/test": "^1.63.0",
|
||||||
"@types/bun": "^1.4.4",
|
"@types/bun": "^1.4.4",
|
||||||
"@types/canvas-confetti": "^1.9.0",
|
"@types/canvas-confetti": "^1.9.0",
|
||||||
"@types/node": "^22.10.2",
|
"@types/node": "^22.10.2",
|
||||||
"@types/react": "~19.0.10",
|
"@types/react": "~19.3.0",
|
||||||
"@types/react-native-razorpay": "^2.2.6",
|
"@types/react-native-razorpay": "^2.2.6",
|
||||||
"eslint": "^9.25.0",
|
"eslint": "^9.25.0",
|
||||||
"eslint-config-expo": "~9.2.0",
|
"eslint-config-expo": "~58.0.4",
|
||||||
"turbo": "^2.0.0",
|
"turbo": "^2.0.0",
|
||||||
"typescript": "~5.8.3"
|
"typescript": "~6.0.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@react-native/virtualized-lists": "^0.79.6",
|
"@react-native/virtualized-lists": "^0.88.1",
|
||||||
"@react-three/drei": "^10.7.7",
|
"@react-three/drei": "^10.7.7",
|
||||||
"@react-three/fiber": "^9.5.0",
|
"@react-three/fiber": "^9.5.0",
|
||||||
"@types/three": "^0.182.0",
|
"@types/three": "^0.182.0",
|
||||||
|
|
@ -48,16 +48,16 @@
|
||||||
"backend": "^1.0.0",
|
"backend": "^1.0.0",
|
||||||
"canvas-confetti": "^1.9.4",
|
"canvas-confetti": "^1.9.4",
|
||||||
"drizzle-orm": "^0.45.1",
|
"drizzle-orm": "^0.45.1",
|
||||||
"expo": "~53.0.22",
|
"expo": "~58.0.26",
|
||||||
"expo-auth-session": "~6.2.1",
|
"expo-auth-session": "~58.0.19",
|
||||||
"expo-crypto": "~14.1.5",
|
"expo-crypto": "~58.0.8",
|
||||||
"expo-server-sdk": "^5.0.0",
|
"expo-server-sdk": "^5.0.0",
|
||||||
"expo-web-browser": "~14.2.0",
|
"expo-web-browser": "~58.1.0",
|
||||||
"fuse.js": "^7.1.0",
|
"fuse.js": "^7.1.0",
|
||||||
"node-cron": "^4.2.1",
|
"node-cron": "^4.2.1",
|
||||||
"pg": "^8.20.0",
|
"pg": "^8.20.0",
|
||||||
"react": "19.0.0",
|
"react": "19.3.0",
|
||||||
"react-native": "0.79.6",
|
"react-native": "0.88.1",
|
||||||
"three": "^0.182.0",
|
"three": "^0.182.0",
|
||||||
"user-ui": "^1.0.0",
|
"user-ui": "^1.0.0",
|
||||||
"zustand": "^5.0.9"
|
"zustand": "^5.0.9"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { DependencyList, useEffect } from 'react';
|
import { DependencyList, useEffect } from 'react';
|
||||||
import { DeviceEventEmitter } from 'react-native';
|
import { DeviceEventEmitter } from 'react-native';
|
||||||
import { useFocusEffect } from '@react-navigation/native';
|
import { useFocusEffect } from 'expo-router';
|
||||||
|
|
||||||
export function useDrawerTitle(title: string, deps: DependencyList) {
|
export function useDrawerTitle(title: string, deps: DependencyList) {
|
||||||
useFocusEffect(() => {
|
useFocusEffect(() => {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { useFocusEffect } from '@react-navigation/native';
|
import { useFocusEffect } from 'expo-router';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { useCallback, useRef } from 'react';
|
import { useCallback, useRef } from 'react';
|
||||||
import { useFocusEffect } from '@react-navigation/native';
|
import { useFocusEffect } from 'expo-router';
|
||||||
|
|
||||||
export const useMarkDataFetchers = (callback: () => void) => {
|
export const useMarkDataFetchers = (callback: () => void) => {
|
||||||
// The callback is held in a ref: call sites pass inline arrows, so putting it in the
|
// The callback is held in a ref: call sites pass inline arrows, so putting it in the
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import { useTheme, Theme } from "./hooks/theme-context";
|
||||||
import MyTextInput from "./src/components/textinput";
|
import MyTextInput from "./src/components/textinput";
|
||||||
import BottomDialog, { ConfirmationDialog, RawBottomDialog } from "./src/components/dialog";
|
import BottomDialog, { ConfirmationDialog, RawBottomDialog } from "./src/components/dialog";
|
||||||
import LoadingDialog from "./src/components/loading-dialog";
|
import LoadingDialog from "./src/components/loading-dialog";
|
||||||
import DatePicker from "./src/components/date-picker";
|
|
||||||
import MyText from "./src/components/text";
|
import MyText from "./src/components/text";
|
||||||
import MyTouchableOpacity from "./src/components/touchable-opacity";
|
import MyTouchableOpacity from "./src/components/touchable-opacity";
|
||||||
import BottomDropdown from "./src/components/bottom-dropdown";
|
import BottomDropdown from "./src/components/bottom-dropdown";
|
||||||
|
|
@ -32,11 +31,12 @@ import useManualRefresh from "./hooks/useManualRefresh";
|
||||||
import { useDrawerTitle } from "./hooks/useDrawerTitle";
|
import { useDrawerTitle } from "./hooks/useDrawerTitle";
|
||||||
import { useMarkDataFetchers } from "./hooks/useMarkDataFetchers";
|
import { useMarkDataFetchers } from "./hooks/useMarkDataFetchers";
|
||||||
import { StorageServiceCasual } from "./src/services/StorageServiceCasual";
|
import { StorageServiceCasual } from "./src/services/StorageServiceCasual";
|
||||||
import DateTimePickerMod from "./src/components/date-time-picker";
|
|
||||||
import { RefreshProvider, useRefresh } from "./src/lib/refresh-context";
|
import { RefreshProvider, useRefresh } from "./src/lib/refresh-context";
|
||||||
import MyStatusBar from "./src/components/MyStatusBar";
|
import MyStatusBar from "./src/components/MyStatusBar";
|
||||||
import { InfoDialog } from "./src/components/info-dialog";
|
import { InfoDialog } from "./src/components/info-dialog";
|
||||||
import { updateStatusBarColor, useStatusBarStore } from "./src/lib/status-bar-store";
|
import { updateStatusBarColor, useStatusBarStore } from "./src/lib/status-bar-store";
|
||||||
|
import { INTER_FONTS, interFamilyFor, InterFamily } from "./src/lib/fonts";
|
||||||
|
import { PAPER_THEME } from "./src/lib/paper-theme";
|
||||||
|
|
||||||
const isDevMode = Constants.executionEnvironment !== "standalone";
|
const isDevMode = Constants.executionEnvironment !== "standalone";
|
||||||
|
|
||||||
|
|
@ -56,7 +56,6 @@ export {
|
||||||
MyTouchableOpacity,
|
MyTouchableOpacity,
|
||||||
ConfirmationDialog,
|
ConfirmationDialog,
|
||||||
RawBottomDialog,
|
RawBottomDialog,
|
||||||
DatePicker,
|
|
||||||
BottomDropdown,
|
BottomDropdown,
|
||||||
ImageViewerURI,
|
ImageViewerURI,
|
||||||
ImageCarousel,
|
ImageCarousel,
|
||||||
|
|
@ -77,11 +76,14 @@ export {
|
||||||
useDrawerTitle,
|
useDrawerTitle,
|
||||||
useMarkDataFetchers,
|
useMarkDataFetchers,
|
||||||
StorageServiceCasual,
|
StorageServiceCasual,
|
||||||
DateTimePickerMod,
|
|
||||||
RefreshProvider,
|
RefreshProvider,
|
||||||
useRefresh,
|
useRefresh,
|
||||||
MyStatusBar,
|
MyStatusBar,
|
||||||
InfoDialog,
|
InfoDialog,
|
||||||
updateStatusBarColor,
|
updateStatusBarColor,
|
||||||
useStatusBarStore,
|
useStatusBarStore,
|
||||||
|
INTER_FONTS,
|
||||||
|
interFamilyFor,
|
||||||
|
InterFamily,
|
||||||
|
PAPER_THEME,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,58 +4,50 @@
|
||||||
"main": "index.ts",
|
"main": "index.ts",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/vector-icons": "^14.1.0",
|
"@expo-google-fonts/inter": "^0.4.2",
|
||||||
"@react-native-community/datetimepicker": "8.4.1",
|
"@expo/vector-icons": "^15.0.2",
|
||||||
"@react-native-google-signin/google-signin": "^16.0.0",
|
"@react-native-community/datetimepicker": "9.2.1",
|
||||||
"@react-native-picker/picker": "2.11.1",
|
|
||||||
"@react-navigation/bottom-tabs": "^7.3.10",
|
|
||||||
"@react-navigation/drawer": "^7.5.8",
|
"@react-navigation/drawer": "^7.5.8",
|
||||||
"@react-navigation/elements": "^2.3.8",
|
|
||||||
"@react-navigation/native": "^7.1.6",
|
"@react-navigation/native": "^7.1.6",
|
||||||
"@tanstack/react-query": "^5.100.0",
|
"@tanstack/react-query": "^5.100.0",
|
||||||
"axios": "^1.11.0",
|
"axios": "^1.11.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"dayjs": "^1.11.18",
|
"dayjs": "^1.11.18",
|
||||||
"expo": "~53.0.22",
|
"expo": "~58.0.26",
|
||||||
"expo-blur": "~14.1.5",
|
"expo-blur": "~58.0.6",
|
||||||
"expo-constants": "~17.1.7",
|
"expo-constants": "~58.0.16",
|
||||||
"expo-dev-client": "~5.2.4",
|
"expo-dev-client": "~58.0.21",
|
||||||
"expo-device": "~7.1.4",
|
"expo-device": "~58.0.5",
|
||||||
"expo-document-picker": "~13.1.6",
|
"expo-document-picker": "~58.0.5",
|
||||||
"expo-font": "~13.3.2",
|
"expo-font": "~58.0.12",
|
||||||
"expo-haptics": "~14.1.4",
|
"expo-image": "~58.0.18",
|
||||||
"expo-image": "~2.4.0",
|
"expo-image-picker": "~58.0.10",
|
||||||
"expo-image-picker": "~16.1.4",
|
"expo-linear-gradient": "~58.0.4",
|
||||||
"expo-linear-gradient": "~14.1.5",
|
"expo-linking": "~58.0.17",
|
||||||
"expo-linking": "~7.1.7",
|
"expo-notifications": "~58.1.9",
|
||||||
"expo-notifications": "~0.31.4",
|
"expo-router": "~58.0.32",
|
||||||
"expo-router": "~5.1.5",
|
"expo-secure-store": "~58.0.3",
|
||||||
"expo-secure-store": "~14.2.4",
|
"expo-splash-screen": "~58.0.14",
|
||||||
"expo-splash-screen": "~0.30.10",
|
"expo-status-bar": "~58.0.5",
|
||||||
"expo-status-bar": "~2.2.3",
|
"expo-system-ui": "~58.0.7",
|
||||||
"expo-symbols": "~0.4.5",
|
"expo-web-browser": "~58.1.0",
|
||||||
"expo-system-ui": "~5.0.11",
|
|
||||||
"expo-web-browser": "~14.2.0",
|
|
||||||
"formik": "^2.4.6",
|
"formik": "^2.4.6",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"react": "19.0.0",
|
"react": "19.3.0",
|
||||||
"react-dom": "19.0.0",
|
"react-dom": "19.3.0",
|
||||||
"react-hook-form": "^7.62.0",
|
"react-hook-form": "^7.62.0",
|
||||||
"react-native": "0.79.6",
|
"react-native": "0.88.1",
|
||||||
"react-native-element-dropdown": "^2.12.4",
|
"react-native-gesture-handler": "~3.3.0",
|
||||||
"react-native-gesture-handler": "~2.24.0",
|
|
||||||
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
||||||
"react-native-pager-view": "^6.9.1",
|
|
||||||
"react-native-paper": "^5.14.5",
|
"react-native-paper": "^5.14.5",
|
||||||
"react-native-phonepe-pg": "^3.1.1",
|
"react-native-phonepe-pg": "^3.1.1",
|
||||||
"react-native-razorpay": "^2.3.0",
|
"react-native-reanimated": "4.7.1",
|
||||||
"react-native-reanimated": "~3.17.4",
|
"react-native-safe-area-context": "~5.11.1",
|
||||||
"react-native-safe-area-context": "5.4.0",
|
"react-native-screens": "~4.30.1",
|
||||||
"react-native-screens": "~4.11.1",
|
|
||||||
"react-native-tab-view": "^4.1.3",
|
|
||||||
"react-native-toast-message": "^2.3.3",
|
"react-native-toast-message": "^2.3.3",
|
||||||
"react-native-web": "~0.20.0",
|
"react-native-web": "~0.21.4",
|
||||||
"react-native-webview": "13.13.5",
|
"react-native-webview": "14.0.1",
|
||||||
|
"react-native-worklets": "0.13.0",
|
||||||
"twrnc": "^4.9.1",
|
"twrnc": "^4.9.1",
|
||||||
"yup": "^1.7.0",
|
"yup": "^1.7.0",
|
||||||
"zustand": "^5.0.10"
|
"zustand": "^5.0.10"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import type { ImageUploaderProps } from '@packages/shared';
|
||||||
import MyText from "./text";
|
import MyText from "./text";
|
||||||
import tw from '../lib/tailwind';
|
import tw from '../lib/tailwind';
|
||||||
import Ionicons from "@expo/vector-icons/Ionicons";
|
import Ionicons from "@expo/vector-icons/Ionicons";
|
||||||
import { MaterialIcons } from "@expo/vector-icons";
|
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
|
||||||
|
|
||||||
const ImageUploader: React.FC<ImageUploaderProps> = ({
|
const ImageUploader: React.FC<ImageUploaderProps> = ({
|
||||||
images,
|
images,
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@ import React from 'react'
|
||||||
import { View } from 'react-native'
|
import { View } from 'react-native'
|
||||||
import { Image } from 'expo-image'
|
import { Image } from 'expo-image'
|
||||||
import Ionicons from '@expo/vector-icons/Ionicons'
|
import Ionicons from '@expo/vector-icons/Ionicons'
|
||||||
import { MaterialIcons } from '@expo/vector-icons'
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';import type { ImageUploaderNeoItem, ImageUploaderNeoPayload, ImageUploaderNeoProps } from '@packages/shared'
|
||||||
import type { ImageUploaderNeoItem, ImageUploaderNeoPayload, ImageUploaderNeoProps } from '@packages/shared'
|
|
||||||
import tw from '../lib/tailwind'
|
import tw from '../lib/tailwind'
|
||||||
import MyText from './text'
|
import MyText from './text'
|
||||||
import MyTouchableOpacity from './touchable-opacity'
|
import MyTouchableOpacity from './touchable-opacity'
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,25 @@
|
||||||
import React, { useState, useCallback, useRef, useEffect } from 'react';
|
import React, { useState, useCallback, useRef, useEffect } from 'react';
|
||||||
import { Text, View, TouchableOpacity, ScrollView, TextInput, Dimensions } from 'react-native';
|
import { View, TouchableOpacity, ScrollView, TextInput, Dimensions } from 'react-native';
|
||||||
import { Ionicons } from '@expo/vector-icons';
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
||||||
import { BottomDialog } from './dialog';
|
import { BottomDialog } from './dialog';
|
||||||
import MyText from './text';
|
import MyText from './text';
|
||||||
import { useTheme } from '../../hooks/theme-context';
|
import { useTheme } from '../../hooks/theme-context';
|
||||||
import tw from '../lib/tailwind';
|
import tw from '../lib/tailwind';
|
||||||
import { colors } from '../lib/theme-colors';
|
import { colors } from '../lib/theme-colors';
|
||||||
import type { DropdownOption as BaseDropdownOption } from '@packages/shared';
|
import type { DropdownOption as BaseDropdownOption } from '@packages/shared';
|
||||||
import type { DropdownBaseProps } from './dropdown';
|
|
||||||
|
// Shared shape for the dropdown components. Used to live in ./dropdown, which
|
||||||
|
// wrapped react-native-element-dropdown; that component had no consumers, so
|
||||||
|
// the type lives here now and the dependency is gone.
|
||||||
|
export interface DropdownBaseProps<O> {
|
||||||
|
label: string;
|
||||||
|
options: O[];
|
||||||
|
error?: boolean;
|
||||||
|
style?: any;
|
||||||
|
placeholder?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
// Bottom/multi dropdown option — shared base + per-option disabled flag
|
// Bottom/multi dropdown option — shared base + per-option disabled flag
|
||||||
export interface DropdownOption extends BaseDropdownOption {
|
export interface DropdownOption extends BaseDropdownOption {
|
||||||
|
|
@ -79,7 +91,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
// Which option's `detail` is expanded (one at a time).
|
// Which option's `detail` is expanded (one at a time).
|
||||||
const [expandedValue, setExpandedValue] = useState<string | number | null>(null);
|
const [expandedValue, setExpandedValue] = useState<string | number | null>(null);
|
||||||
const debounceTimeoutRef = useRef<number | null>(null);
|
const debounceTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||||
|
|
||||||
// Debounced search function
|
// Debounced search function
|
||||||
const debouncedOnSearch = useCallback((query: string) => {
|
const debouncedOnSearch = useCallback((query: string) => {
|
||||||
|
|
@ -181,7 +193,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
|
||||||
onPress={() => !disabled && setIsOpen(true)}
|
onPress={() => !disabled && setIsOpen(true)}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
<Text
|
<MyText
|
||||||
style={[
|
style={[
|
||||||
tw`flex-1`,
|
tw`flex-1`,
|
||||||
(multiple ? (value as string[]).length > 0 : options.some(opt => opt.value === value))
|
(multiple ? (value as string[]).length > 0 : options.some(opt => opt.value === value))
|
||||||
|
|
@ -192,7 +204,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
|
||||||
numberOfLines={1}
|
numberOfLines={1}
|
||||||
>
|
>
|
||||||
{getDisplayText()}
|
{getDisplayText()}
|
||||||
</Text>
|
</MyText>
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="chevron-down"
|
name="chevron-down"
|
||||||
size={16}
|
size={16}
|
||||||
|
|
@ -212,7 +224,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<View style={tw`py-4`}>
|
<View style={tw`py-4`}>
|
||||||
<Text style={tw`text-lg font-semibold mb-4 text-center`}>{label}</Text>
|
<MyText style={tw`text-lg font-semibold mb-4 text-center`}>{label}</MyText>
|
||||||
|
|
||||||
{/* Search Input - Fixed at top */}
|
{/* Search Input - Fixed at top */}
|
||||||
{onSearch && (
|
{onSearch && (
|
||||||
|
|
@ -238,9 +250,9 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
|
||||||
>
|
>
|
||||||
{filteredOptions.length === 0 && searchQuery ? (
|
{filteredOptions.length === 0 && searchQuery ? (
|
||||||
<View style={tw`py-8 px-4 items-center`}>
|
<View style={tw`py-8 px-4 items-center`}>
|
||||||
<Text style={tw`text-gray-500 text-center`}>
|
<MyText style={tw`text-gray-500 text-center`}>
|
||||||
No options found for "{searchQuery}"
|
No options found for "{searchQuery}"
|
||||||
</Text>
|
</MyText>
|
||||||
</View>
|
</View>
|
||||||
) : (
|
) : (
|
||||||
filteredOptions.map((option) => {
|
filteredOptions.map((option) => {
|
||||||
|
|
@ -262,27 +274,27 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
|
||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
>
|
>
|
||||||
<View style={tw`flex-1 mr-2`}>
|
<View style={tw`flex-1 mr-2`}>
|
||||||
<Text
|
<MyText
|
||||||
style={[
|
style={[
|
||||||
selected ? tw`text-brand700 font-semibold` : tw`text-gray-800`,
|
selected ? tw`text-brand700 font-semibold` : tw`text-gray-800`,
|
||||||
isDisabled && tw`text-gray-400`,
|
isDisabled && tw`text-gray-400`,
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Text style={tw`font-bold`}>{code}</Text>
|
<MyText style={tw`font-bold`}>{code}</MyText>
|
||||||
{rest ? ` - ${rest}` : ''}
|
{rest ? ` - ${rest}` : ''}
|
||||||
{option.disabled && option.note ? (
|
{option.disabled && option.note ? (
|
||||||
<Text style={tw`italic`}> Disabled</Text>
|
<MyText style={tw`italic`}> Disabled</MyText>
|
||||||
) : null}
|
) : null}
|
||||||
</Text>
|
</MyText>
|
||||||
{!!option.note && (
|
{!!option.note && (
|
||||||
<Text
|
<MyText
|
||||||
style={[
|
style={[
|
||||||
tw`text-xs mt-0.5`,
|
tw`text-xs mt-0.5`,
|
||||||
isDisabled ? tw`text-gray-400` : tw`text-gray-500`,
|
isDisabled ? tw`text-gray-400` : tw`text-gray-500`,
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{option.note}
|
{option.note}
|
||||||
</Text>
|
</MyText>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
{selected && (
|
{selected && (
|
||||||
|
|
@ -307,9 +319,9 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
|
||||||
color={colors.brand500}
|
color={colors.brand500}
|
||||||
style={tw`mr-1`}
|
style={tw`mr-1`}
|
||||||
/>
|
/>
|
||||||
<Text style={tw`text-xs font-medium text-brand500`}>
|
<MyText style={tw`text-xs font-medium text-brand500`}>
|
||||||
{option.detail.label}
|
{option.detail.label}
|
||||||
</Text>
|
</MyText>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
{isDetailOpen && (
|
{isDetailOpen && (
|
||||||
|
|
@ -340,7 +352,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
|
||||||
style={[tw`px-4 py-2 rounded-md flex-1 mr-2`, { backgroundColor: colors.brand500 }]}
|
style={[tw`px-4 py-2 rounded-md flex-1 mr-2`, { backgroundColor: colors.brand500 }]}
|
||||||
onPress={handleDone}
|
onPress={handleDone}
|
||||||
>
|
>
|
||||||
<Text style={tw`text-white text-center font-medium`}>Done</Text>
|
<MyText style={tw`text-white text-center font-medium`}>Done</MyText>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { useTheme } from "common-ui";
|
import { useTheme } from "common-ui";
|
||||||
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Platform, TouchableOpacity, ViewStyle } from 'react-native';
|
import { Platform, TouchableOpacity, ViewStyle } from 'react-native';
|
||||||
// import { useTheme } from '../hooks/theme-context';
|
// import { useTheme } from '../hooks/theme-context';
|
||||||
|
|
@ -31,9 +31,11 @@ const Checkbox: React.FC<CheckboxProps> = ({
|
||||||
const { colors } = useTheme().theme;
|
const { colors } = useTheme().theme;
|
||||||
const fill = fillColor || colors.brand500;
|
const fill = fillColor || colors.brand500;
|
||||||
const check = checkColor || colors.white1;
|
const check = checkColor || colors.white1;
|
||||||
|
// MaterialIcons glyphs: filled box/circle with the tick knocked out, same
|
||||||
|
// visual as the MaterialCommunityIcons set this used to require (1.3 MB).
|
||||||
const iconName = Platform.OS === 'android'
|
const iconName = Platform.OS === 'android'
|
||||||
? checked ? 'checkbox-marked' : 'checkbox-blank-outline'
|
? checked ? 'check-box' : 'check-box-outline-blank'
|
||||||
: checked ? 'checkbox-marked-circle' : 'checkbox-blank-circle-outline';
|
: checked ? 'check-circle' : 'radio-button-unchecked';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
|
@ -45,7 +47,7 @@ const Checkbox: React.FC<CheckboxProps> = ({
|
||||||
accessibilityRole="checkbox"
|
accessibilityRole="checkbox"
|
||||||
accessibilityState={{ checked, disabled }}
|
accessibilityState={{ checked, disabled }}
|
||||||
>
|
>
|
||||||
<MaterialCommunityIcons
|
<MaterialIcons
|
||||||
name={iconName}
|
name={iconName}
|
||||||
size={size}
|
size={size}
|
||||||
color={disabled ? colors.gray1 : fill}
|
color={disabled ? colors.gray1 : fill}
|
||||||
|
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
||||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
|
||||||
import DateTimePicker, {
|
|
||||||
AndroidNativeProps,
|
|
||||||
DateTimePickerAndroid,
|
|
||||||
DateTimePickerEvent,
|
|
||||||
} from "@react-native-community/datetimepicker";
|
|
||||||
import React, { useState } from "react";
|
|
||||||
import {
|
|
||||||
Modal,
|
|
||||||
Platform,
|
|
||||||
Text,
|
|
||||||
TouchableOpacity,
|
|
||||||
View,
|
|
||||||
} from "react-native";
|
|
||||||
import MyText from "./text";
|
|
||||||
import { useTheme, tw } from "common-ui";
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
value: Date | null;
|
|
||||||
setValue: (date: Date | null) => void;
|
|
||||||
showLabel?: boolean; // Optional prop to control label visibility
|
|
||||||
placeholder?: string; // Optional custom placeholder
|
|
||||||
}
|
|
||||||
|
|
||||||
function DatePicker(props: Props) {
|
|
||||||
const { value, setValue, showLabel = true, placeholder = "Select Date" } = props;
|
|
||||||
const [show, setShow] = useState<boolean>(false);
|
|
||||||
const { theme } = useTheme();
|
|
||||||
|
|
||||||
const onChange = (event: DateTimePickerEvent, selectedDate?: Date) => {
|
|
||||||
const currentDate = selectedDate || value;
|
|
||||||
if (Platform.OS === "ios") setShow(false);
|
|
||||||
setValue(currentDate);
|
|
||||||
};
|
|
||||||
|
|
||||||
const showDatepicker = () => {
|
|
||||||
if (Platform.OS === "android") {
|
|
||||||
DateTimePickerAndroid.open({
|
|
||||||
value: value || new Date(),
|
|
||||||
onChange: onChange,
|
|
||||||
mode: "date",
|
|
||||||
is24Hour: true,
|
|
||||||
display: "default",
|
|
||||||
} as AndroidNativeProps);
|
|
||||||
} else {
|
|
||||||
setShow(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<View style={tw`justify-center items-start p-0 w-full`}>
|
|
||||||
<TouchableOpacity onPress={showDatepicker} style={tw`w-full`}>
|
|
||||||
{showLabel && <MyText style={tw`text-xs`}>{placeholder}</MyText>}
|
|
||||||
<View
|
|
||||||
style={[tw`flex-row items-center border border-gray5 rounded py-2 px-2 justify-between`]}
|
|
||||||
>
|
|
||||||
<Text style={[tw`text-sm font-medium text-gray-800 ml-1 mr-1`, { opacity: value ? 1 : 0.5 }]}>
|
|
||||||
{value?.toLocaleDateString() || placeholder}
|
|
||||||
</Text>
|
|
||||||
<MaterialCommunityIcons
|
|
||||||
name="calendar"
|
|
||||||
size={24}
|
|
||||||
color={theme.colors.gray5}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</TouchableOpacity>
|
|
||||||
|
|
||||||
{/* Conditional rendering for iOS, as it uses the declarative API */}
|
|
||||||
{show && Platform.OS === "ios" && (
|
|
||||||
<Modal
|
|
||||||
transparent
|
|
||||||
animationType="fade"
|
|
||||||
visible={show}
|
|
||||||
onRequestClose={() => setShow(false)}
|
|
||||||
>
|
|
||||||
<View style={[tw`flex-1 justify-center items-center`, { backgroundColor: "rgba(0, 0, 0, 0.5)" }]}>
|
|
||||||
<View style={[tw`w-4/5 bg-white rounded-xl p-5`, { elevation: 5 }]}>
|
|
||||||
<DateTimePicker
|
|
||||||
testID="dateTimePicker"
|
|
||||||
value={value || new Date()}
|
|
||||||
mode="date"
|
|
||||||
is24Hour={true}
|
|
||||||
display="default"
|
|
||||||
onChange={onChange}
|
|
||||||
/>
|
|
||||||
<TouchableOpacity
|
|
||||||
onPress={() => setShow(false)}
|
|
||||||
style={tw`mt-2.5 bg-blue-500 rounded py-2.5 items-center`}
|
|
||||||
>
|
|
||||||
<Text style={tw`text-white font-bold`}>Done</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</Modal>
|
|
||||||
)}
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default DatePicker;
|
|
||||||
|
|
@ -1,17 +1,11 @@
|
||||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
import MaterialCommunityIcons from "@expo/vector-icons/MaterialCommunityIcons";
|
||||||
import DateTimePicker, {
|
import DateTimePicker, {
|
||||||
AndroidNativeProps,
|
AndroidNativeProps,
|
||||||
DateTimePickerAndroid,
|
DateTimePickerAndroid,
|
||||||
DateTimePickerEvent,
|
DateTimePickerEvent,
|
||||||
} from "@react-native-community/datetimepicker";
|
} from "@react-native-community/datetimepicker";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import {
|
import { Modal, Platform, TouchableOpacity, View } from "react-native";
|
||||||
Modal,
|
|
||||||
Platform,
|
|
||||||
Text,
|
|
||||||
TouchableOpacity,
|
|
||||||
View,
|
|
||||||
} from "react-native";
|
|
||||||
|
|
||||||
import { useTheme, tw } from "common-ui";
|
import { useTheme, tw } from "common-ui";
|
||||||
import MyText from './text';
|
import MyText from './text';
|
||||||
|
|
@ -68,12 +62,12 @@ function DateTimePickerMod(props: Props) {
|
||||||
<TouchableOpacity testID={testID} accessibilityLabel={testID} onPress={showTimepicker} style={tw`w-full`}>
|
<TouchableOpacity testID={testID} accessibilityLabel={testID} onPress={showTimepicker} style={tw`w-full`}>
|
||||||
{showLabels && <MyText style={tw`text-xs`}>Select Time</MyText>}
|
{showLabels && <MyText style={tw`text-xs`}>Select Time</MyText>}
|
||||||
<View style={tw`flex-row items-center border border-gray5 rounded py-1 px-1 justify-between gap-1`}>
|
<View style={tw`flex-row items-center border border-gray5 rounded py-1 px-1 justify-between gap-1`}>
|
||||||
<Text style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>
|
<MyText style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>
|
||||||
{value?.toLocaleTimeString([], {
|
{value?.toLocaleTimeString([], {
|
||||||
hour: "2-digit",
|
hour: "2-digit",
|
||||||
minute: "2-digit",
|
minute: "2-digit",
|
||||||
}) || "Select Time"}
|
}) || "Select Time"}
|
||||||
</Text>
|
</MyText>
|
||||||
<MaterialCommunityIcons
|
<MaterialCommunityIcons
|
||||||
name="clock"
|
name="clock"
|
||||||
size={24}
|
size={24}
|
||||||
|
|
@ -91,7 +85,7 @@ function DateTimePickerMod(props: Props) {
|
||||||
>
|
>
|
||||||
{showLabels && <MyText style={tw`text-xs`}>Select Date</MyText>}
|
{showLabels && <MyText style={tw`text-xs`}>Select Date</MyText>}
|
||||||
<View style={tw`flex-row items-center border border-gray5 rounded py-1 px-1 justify-between`}>
|
<View style={tw`flex-row items-center border border-gray5 rounded py-1 px-1 justify-between`}>
|
||||||
<Text style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>{value?.toLocaleDateString() || "Select Date"}</Text>
|
<MyText style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>{value?.toLocaleDateString() || "Select Date"}</MyText>
|
||||||
<MaterialCommunityIcons
|
<MaterialCommunityIcons
|
||||||
name="calendar"
|
name="calendar"
|
||||||
size={24}
|
size={24}
|
||||||
|
|
@ -108,12 +102,12 @@ function DateTimePickerMod(props: Props) {
|
||||||
>
|
>
|
||||||
{showLabels && <MyText style={tw`text-xs`}>Select Time</MyText>}
|
{showLabels && <MyText style={tw`text-xs`}>Select Time</MyText>}
|
||||||
<View style={tw`flex-row items-center border border-gray5 rounded py-1 px-1 justify-between gap-1`}>
|
<View style={tw`flex-row items-center border border-gray5 rounded py-1 px-1 justify-between gap-1`}>
|
||||||
<Text style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>
|
<MyText style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>
|
||||||
{value?.toLocaleTimeString([], {
|
{value?.toLocaleTimeString([], {
|
||||||
hour: "2-digit",
|
hour: "2-digit",
|
||||||
minute: "2-digit",
|
minute: "2-digit",
|
||||||
}) || "Select Time"}
|
}) || "Select Time"}
|
||||||
</Text>
|
</MyText>
|
||||||
<MaterialCommunityIcons
|
<MaterialCommunityIcons
|
||||||
name="clock"
|
name="clock"
|
||||||
size={24}
|
size={24}
|
||||||
|
|
@ -145,7 +139,7 @@ function DateTimePickerMod(props: Props) {
|
||||||
onPress={() => setShow(false)}
|
onPress={() => setShow(false)}
|
||||||
style={tw`mt-2.5 bg-blue-500 rounded py-2.5 items-center`}
|
style={tw`mt-2.5 bg-blue-500 rounded py-2.5 items-center`}
|
||||||
>
|
>
|
||||||
<Text style={tw`text-white font-bold`}>Done</Text>
|
<MyText style={tw`text-white font-bold`}>Done</MyText>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -1,85 +0,0 @@
|
||||||
import tw from "../lib/tailwind";
|
|
||||||
import React from "react";
|
|
||||||
import { Text, View } from "react-native";
|
|
||||||
import { Dropdown } from "react-native-element-dropdown";
|
|
||||||
import type { DropdownOption } from '@packages/shared';
|
|
||||||
|
|
||||||
export type { DropdownOption } from '@packages/shared';
|
|
||||||
|
|
||||||
// Common dropdown scaffold — value/onValueChange stay per-variant because the
|
|
||||||
// single dropdown carries a scalar and the bottom/multi one carries arrays.
|
|
||||||
// The option element type is generic: the bottom/multi dropdown extends the
|
|
||||||
// shared DropdownOption with a per-option disabled flag.
|
|
||||||
export interface DropdownBaseProps<O = DropdownOption> {
|
|
||||||
label: string;
|
|
||||||
options: O[];
|
|
||||||
error?: boolean;
|
|
||||||
style?: any;
|
|
||||||
placeholder?: string;
|
|
||||||
disabled?: boolean;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Props extends DropdownBaseProps {
|
|
||||||
value: string | number;
|
|
||||||
onValueChange: (value: string | number) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CustomDropdown: React.FC<Props> = ({
|
|
||||||
label,
|
|
||||||
value,
|
|
||||||
options,
|
|
||||||
onValueChange,
|
|
||||||
error,
|
|
||||||
style,
|
|
||||||
placeholder,
|
|
||||||
disabled,
|
|
||||||
className,
|
|
||||||
}) => {
|
|
||||||
return (
|
|
||||||
<View style={[tw``, style]}>
|
|
||||||
<Dropdown
|
|
||||||
data={options}
|
|
||||||
labelField="label"
|
|
||||||
valueField="value"
|
|
||||||
value={value}
|
|
||||||
onChange={(item) => onValueChange(item.value)}
|
|
||||||
placeholder={placeholder ?? label}
|
|
||||||
placeholderStyle={[tw`text-gray-500`, disabled && tw`text-gray-400`]}
|
|
||||||
style={[
|
|
||||||
tw`border rounded-md px-3 py-2 bg-white`,
|
|
||||||
error ? tw`border-red-500` : tw`border-gray-300`,
|
|
||||||
disabled && tw`bg-gray-100 border-gray-200`,
|
|
||||||
tw`${className || ''}`,
|
|
||||||
]}
|
|
||||||
disable={disabled}
|
|
||||||
renderItem={(item: DropdownOption) => {
|
|
||||||
const isSelected = value === item.value;
|
|
||||||
return (
|
|
||||||
<View
|
|
||||||
style={[
|
|
||||||
tw`px-3 py-2 rounded-md my-1`,
|
|
||||||
isSelected ? tw`bg-blue-50` : tw`bg-white`,
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Text
|
|
||||||
style={[
|
|
||||||
isSelected ? tw`text-blue-800 font-semibold` : tw`text-gray-800`,
|
|
||||||
disabled && tw`text-gray-400`,
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
{item.label}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
selectedTextStyle={disabled ? tw`text-gray-400` : tw`text-gray-800 font-medium`}
|
|
||||||
// the dropdown's listProps / containerProps can be tuned if needed:
|
|
||||||
// dropdownStyle etc. Example:
|
|
||||||
// dropdownStyle={tw`bg-white`}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CustomDropdown;
|
|
||||||
|
|
@ -9,7 +9,7 @@ import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Platform,
|
Platform,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import Ionicons from "@expo/vector-icons/Ionicons";
|
||||||
|
|
||||||
interface ImageViewerProps {
|
interface ImageViewerProps {
|
||||||
uri: string;
|
uri: string;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View, TouchableOpacity, Text } from 'react-native';
|
import { View, TouchableOpacity } from 'react-native';
|
||||||
import { MaterialIcons } from '@expo/vector-icons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
import tw from '../lib/tailwind';
|
import tw from '../lib/tailwind';
|
||||||
|
import MyText from './text';
|
||||||
import CartIcon from './icons/CartIcon';
|
import CartIcon from './icons/CartIcon';
|
||||||
|
|
||||||
interface MiniQuantifierProps {
|
interface MiniQuantifierProps {
|
||||||
|
|
@ -23,9 +24,9 @@ const MiniQuantifier: React.FC<MiniQuantifierProps> = ({ value, onChange, showUn
|
||||||
<MaterialIcons name="remove" size={12} color="#4B5563" />
|
<MaterialIcons name="remove" size={12} color="#4B5563" />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<View style={tw`px-1 flex-row items-center`}>
|
<View style={tw`px-1 flex-row items-center`}>
|
||||||
<Text testID="mini-quantifier-value" style={tw`text-center text-gray-900 font-bold text-xs`}>{value}</Text>
|
<MyText testID="mini-quantifier-value" style={tw`text-center text-gray-900 font-bold text-xs`}>{value}</MyText>
|
||||||
{showUnits && unit && (
|
{showUnits && unit && (
|
||||||
<Text style={tw`text-xs text-gray-400 font-medium ml-0.5`}>{unit}</Text>
|
<MyText style={tw`text-xs text-gray-400 font-medium ml-0.5`}>{unit}</MyText>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
|
|
|
||||||
|
|
@ -1,118 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { ImageStyle, StyleSheet, TextStyle, View, ViewStyle, Text } from 'react-native';
|
|
||||||
import { Image } from 'expo-image';
|
|
||||||
import { MultiSelect } from 'react-native-element-dropdown';
|
|
||||||
|
|
||||||
export interface DropdownOption {
|
|
||||||
label: string;
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MultiSelectDropdownProps {
|
|
||||||
data: DropdownOption[];
|
|
||||||
value: string[];
|
|
||||||
onChange: (value: string[]) => void;
|
|
||||||
placeholder?: string;
|
|
||||||
labelField?: string;
|
|
||||||
valueField?: string;
|
|
||||||
style?: ViewStyle;
|
|
||||||
dropdownStyle?: ViewStyle;
|
|
||||||
placeholderStyle?: TextStyle;
|
|
||||||
selectedTextStyle?: TextStyle;
|
|
||||||
inputSearchStyle?: TextStyle;
|
|
||||||
iconStyle?: ImageStyle;
|
|
||||||
search?: boolean;
|
|
||||||
maxHeight?: number;
|
|
||||||
disabled?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MultiSelectDropdown: React.FC<MultiSelectDropdownProps> = ({
|
|
||||||
data,
|
|
||||||
value,
|
|
||||||
onChange,
|
|
||||||
placeholder = 'Select',
|
|
||||||
labelField = 'label',
|
|
||||||
valueField = 'value',
|
|
||||||
style,
|
|
||||||
dropdownStyle,
|
|
||||||
placeholderStyle,
|
|
||||||
selectedTextStyle,
|
|
||||||
inputSearchStyle,
|
|
||||||
iconStyle,
|
|
||||||
search = true,
|
|
||||||
maxHeight = 300,
|
|
||||||
disabled = false,
|
|
||||||
}) => {
|
|
||||||
return (
|
|
||||||
<View style={style}>
|
|
||||||
<MultiSelect
|
|
||||||
style={[styles.dropdown, dropdownStyle]}
|
|
||||||
placeholderStyle={[styles.placeholderStyle, placeholderStyle]}
|
|
||||||
selectedTextStyle={[styles.selectedTextStyle, selectedTextStyle]}
|
|
||||||
inputSearchStyle={[styles.inputSearchStyle, inputSearchStyle]}
|
|
||||||
iconStyle={[styles.iconStyle, iconStyle]}
|
|
||||||
data={data}
|
|
||||||
search={search}
|
|
||||||
maxHeight={maxHeight}
|
|
||||||
labelField={labelField}
|
|
||||||
valueField={valueField}
|
|
||||||
placeholder={placeholder}
|
|
||||||
value={value}
|
|
||||||
onChange={onChange}
|
|
||||||
disable={disabled}
|
|
||||||
renderItem={(item: DropdownOption) => {
|
|
||||||
const isSelected = value.includes(item.value);
|
|
||||||
return (
|
|
||||||
<View style={[styles.item, isSelected && styles.selectedItem]}>
|
|
||||||
<Text style={isSelected ? styles.selectedTextStyle : styles.itemTextStyle}>
|
|
||||||
{item.label}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
dropdown: {
|
|
||||||
borderColor: '#ccc',
|
|
||||||
borderWidth: 1,
|
|
||||||
borderRadius: 8,
|
|
||||||
padding: 8,
|
|
||||||
backgroundColor: '#fff',
|
|
||||||
},
|
|
||||||
placeholderStyle: {
|
|
||||||
color: '#888',
|
|
||||||
fontSize: 16,
|
|
||||||
},
|
|
||||||
selectedTextStyle: {
|
|
||||||
color: '#333',
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
},
|
|
||||||
itemTextStyle: {
|
|
||||||
color: '#333',
|
|
||||||
fontSize: 16,
|
|
||||||
},
|
|
||||||
inputSearchStyle: {
|
|
||||||
color: '#333',
|
|
||||||
fontSize: 16,
|
|
||||||
},
|
|
||||||
iconStyle: {
|
|
||||||
width: 24,
|
|
||||||
height: 24,
|
|
||||||
} as ImageStyle,
|
|
||||||
item: {
|
|
||||||
padding: 10,
|
|
||||||
borderRadius: 6,
|
|
||||||
backgroundColor: '#fff',
|
|
||||||
marginVertical: 2,
|
|
||||||
},
|
|
||||||
selectedItem: {
|
|
||||||
backgroundColor: '#e0f0ff', // Light blue for selected
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export default MultiSelectDropdown;
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { TouchableOpacity, View } from 'react-native';
|
import { TouchableOpacity, View } from 'react-native';
|
||||||
import { Image } from 'expo-image';
|
import { Image } from 'expo-image';
|
||||||
import { Ionicons } from '@expo/vector-icons';
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
||||||
import usePickImage from './use-pick-image';
|
import usePickImage from './use-pick-image';
|
||||||
import tw from '../lib/tailwind';
|
import tw from '../lib/tailwind';
|
||||||
import { theme } from '../theme';
|
import { theme } from '../theme';
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { View, TouchableOpacity, Text } from 'react-native';
|
import { View, TouchableOpacity } from 'react-native';
|
||||||
import { MaterialIcons } from '@expo/vector-icons';
|
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
|
||||||
import type { QuantifierProps } from '@packages/shared';
|
import type { QuantifierProps } from '@packages/shared';
|
||||||
import tw from '../lib/tailwind';
|
import tw from '../lib/tailwind';
|
||||||
|
import MyText from './text';
|
||||||
import { colors } from '../lib/theme-colors';
|
import { colors } from '../lib/theme-colors';
|
||||||
|
|
||||||
const Quantifier: React.FC<QuantifierProps> = ({
|
const Quantifier: React.FC<QuantifierProps> = ({
|
||||||
|
|
@ -30,14 +31,14 @@ const Quantifier: React.FC<QuantifierProps> = ({
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|
||||||
<View style={tw`flex-1 flex-row items-center justify-center px-1`}>
|
<View style={tw`flex-1 flex-row items-center justify-center px-1`}>
|
||||||
<Text testID={`${testID}-value`} style={tw`text-center text-gray-900 font-bold text-base`}>
|
<MyText testID={`${testID}-value`} style={tw`text-center text-gray-900 font-bold text-base`}>
|
||||||
{value}
|
{value}
|
||||||
</Text>
|
</MyText>
|
||||||
{/* {unitText && (
|
{/* {unitText && (
|
||||||
//hide unit text for now
|
//hide unit text for now
|
||||||
<Text style={tw`text-xs text-gray-400 font-medium ml-0.5 mt-0.5`}>
|
<MyText style={tw`text-xs text-gray-400 font-medium ml-0.5 mt-0.5`}>
|
||||||
{unitText}
|
{unitText}
|
||||||
</Text>
|
</MyText>
|
||||||
)} */}
|
)} */}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text as PaperText } from 'react-native-paper';
|
import { Text as PaperText } from 'react-native-paper';
|
||||||
import { TextProps as RNTextProps } from 'react-native';
|
import { TextProps as RNTextProps } from 'react-native';
|
||||||
|
import { StyleSheet } from 'react-native';
|
||||||
|
import { interFamilyFor } from '../lib/fonts';
|
||||||
import { useTheme } from "common-ui";
|
import { useTheme } from "common-ui";
|
||||||
import type { Theme } from "common-ui";
|
import type { Theme } from "common-ui";
|
||||||
// import { useTheme } from '../hooks/theme-context';
|
// import { useTheme } from '../hooks/theme-context';
|
||||||
|
|
@ -11,6 +13,15 @@ type ThemeColor = keyof Theme['colors'];
|
||||||
|
|
||||||
type FontWeight = 'light' | 'regular' | 'medium' | 'semibold' | 'bold';
|
type FontWeight = 'light' | 'regular' | 'medium' | 'semibold' | 'bold';
|
||||||
|
|
||||||
|
/** MyText's `weight` prop -> a flexbox font weight. */
|
||||||
|
const WEIGHT_PROP: Record<FontWeight, '300' | '400' | '500' | '600' | '700'> = {
|
||||||
|
light: '300',
|
||||||
|
regular: '400',
|
||||||
|
medium: '500',
|
||||||
|
semibold: '600',
|
||||||
|
bold: '700',
|
||||||
|
};
|
||||||
|
|
||||||
interface Props extends RNTextProps {
|
interface Props extends RNTextProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
color?: ThemeColor;
|
color?: ThemeColor;
|
||||||
|
|
@ -20,40 +31,26 @@ interface Props extends RNTextProps {
|
||||||
function MyText({ style, children, color, weight = 'regular', ...rest }: Props) {
|
function MyText({ style, children, color, weight = 'regular', ...rest }: Props) {
|
||||||
const { colors } = useTheme().theme;
|
const { colors } = useTheme().theme;
|
||||||
|
|
||||||
// Map weight to fontFamily and fontWeight
|
|
||||||
let fontFamily = 'Nunito-Regular';
|
|
||||||
let fontWeight: any = undefined;
|
|
||||||
switch (weight) {
|
|
||||||
case 'light':
|
|
||||||
fontFamily = 'Nunito-Light';
|
|
||||||
fontWeight = '300';
|
|
||||||
break;
|
|
||||||
case 'regular':
|
|
||||||
fontFamily = 'Nunito-Regular';
|
|
||||||
fontWeight = '400';
|
|
||||||
break;
|
|
||||||
case 'medium':
|
|
||||||
fontFamily = 'Nunito-Medium';
|
|
||||||
fontWeight = '500';
|
|
||||||
break;
|
|
||||||
case 'semibold':
|
|
||||||
fontFamily = 'Nunito-SemiBold';
|
|
||||||
fontWeight = '600';
|
|
||||||
break;
|
|
||||||
case 'bold':
|
|
||||||
fontFamily = 'Nunito-Bold';
|
|
||||||
fontWeight = '700';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
let textColor: string | undefined;
|
let textColor: string | undefined;
|
||||||
if (color && colors[color]) textColor = colors[color];
|
if (color && colors[color]) textColor = colors[color];
|
||||||
|
|
||||||
|
// The family is picked from whichever weight wins: the `weight` prop or a
|
||||||
|
// tw class (`font-bold`) in `style`. The weight itself is removed from the
|
||||||
|
// applied style - on Android a custom family plus fontWeight falls back to
|
||||||
|
// synthesised/system bold instead of the Inter file we loaded.
|
||||||
|
const flat = StyleSheet.flatten(style) || {};
|
||||||
|
const { fontWeight: styleWeight, ...styleWithoutWeight } = flat as {
|
||||||
|
fontWeight?: string | number;
|
||||||
|
[key: string]: unknown;
|
||||||
|
};
|
||||||
|
const fontFamily = interFamilyFor(styleWeight ?? WEIGHT_PROP[weight]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PaperText
|
<PaperText
|
||||||
{...rest}
|
{...rest}
|
||||||
style={[
|
style={[
|
||||||
{ fontFamily, color: textColor, fontWeight },
|
{ color: textColor, fontFamily },
|
||||||
style,
|
styleWithoutWeight,
|
||||||
]}
|
]}
|
||||||
allowFontScaling={false}
|
allowFontScaling={false}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
49
packages/ui/src/lib/fonts.ts
Normal file
49
packages/ui/src/lib/fonts.ts
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
/**
|
||||||
|
* The app font: Inter, one static file per weight.
|
||||||
|
*
|
||||||
|
* React Native cannot pick a weight out of a single family on Android, so every
|
||||||
|
* weight is loaded as its own family (`Inter_700Bold`, not `Inter` + 700) and
|
||||||
|
* `interFamilyFor()` maps a CSS-ish weight to the matching file. Shared by
|
||||||
|
* user-ui and admin-ui so both apps resolve the same names.
|
||||||
|
*/
|
||||||
|
// Import each weight from its own subpath. The package's root index re-exports
|
||||||
|
// every weight (and italics), and Metro has no tree-shaking for CJS asset
|
||||||
|
// requires - the root import bundled all 18 TTFs (~6 MB) instead of 6.
|
||||||
|
import { Inter_400Regular } from '@expo-google-fonts/inter/400Regular'
|
||||||
|
import { Inter_500Medium } from '@expo-google-fonts/inter/500Medium'
|
||||||
|
import { Inter_600SemiBold } from '@expo-google-fonts/inter/600SemiBold'
|
||||||
|
import { Inter_700Bold } from '@expo-google-fonts/inter/700Bold'
|
||||||
|
import { Inter_800ExtraBold } from '@expo-google-fonts/inter/800ExtraBold'
|
||||||
|
import { Inter_900Black } from '@expo-google-fonts/inter/900Black'
|
||||||
|
|
||||||
|
/** Pass straight to `useFonts()` from expo-font. */
|
||||||
|
export const INTER_FONTS = {
|
||||||
|
Inter_400Regular,
|
||||||
|
Inter_500Medium,
|
||||||
|
Inter_600SemiBold,
|
||||||
|
Inter_700Bold,
|
||||||
|
Inter_800ExtraBold,
|
||||||
|
Inter_900Black,
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InterFamily = keyof typeof INTER_FONTS
|
||||||
|
|
||||||
|
const BY_WEIGHT: Record<string, InterFamily> = {
|
||||||
|
'100': 'Inter_400Regular',
|
||||||
|
'200': 'Inter_400Regular',
|
||||||
|
'300': 'Inter_400Regular',
|
||||||
|
'normal': 'Inter_400Regular',
|
||||||
|
'400': 'Inter_400Regular',
|
||||||
|
'500': 'Inter_500Medium',
|
||||||
|
'600': 'Inter_600SemiBold',
|
||||||
|
'bold': 'Inter_700Bold',
|
||||||
|
'700': 'Inter_700Bold',
|
||||||
|
'800': 'Inter_800ExtraBold',
|
||||||
|
'900': 'Inter_900Black',
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Map a flexbox font weight (RN `fontWeight` or MyText's `weight` prop) to a loaded family. */
|
||||||
|
export function interFamilyFor(weight?: string | number | null): InterFamily {
|
||||||
|
if (weight == null) return 'Inter_400Regular'
|
||||||
|
return BY_WEIGHT[String(weight)] ?? 'Inter_400Regular'
|
||||||
|
}
|
||||||
22
packages/ui/src/lib/paper-theme.ts
Normal file
22
packages/ui/src/lib/paper-theme.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
/**
|
||||||
|
* react-native-paper theme whose typography points at the Inter families loaded
|
||||||
|
* by `INTER_FONTS`. Paper's own components (Button labels, TextInput, dialogs)
|
||||||
|
* do not go through MyText, so without this they would stay on the system font.
|
||||||
|
*/
|
||||||
|
import { configureFonts, DefaultTheme } from 'react-native-paper'
|
||||||
|
|
||||||
|
import { interFamilyFor } from './fonts'
|
||||||
|
|
||||||
|
const base = configureFonts({ config: { fontFamily: 'Inter_400Regular' } })
|
||||||
|
|
||||||
|
const fonts = Object.fromEntries(
|
||||||
|
Object.entries(base).map(([variant, type]) => {
|
||||||
|
const { fontWeight } = type as { fontWeight?: string | number }
|
||||||
|
return [variant, { ...(type as object), fontFamily: interFamilyFor(fontWeight) }]
|
||||||
|
})
|
||||||
|
) as typeof base
|
||||||
|
|
||||||
|
export const PAPER_THEME = {
|
||||||
|
...DefaultTheme,
|
||||||
|
fonts,
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue