Compare commits

..

No commits in common. "1.3.0_i1" and "main" have entirely different histories.

85 changed files with 1378 additions and 3769 deletions

2
.gitignore vendored
View file

@ -150,5 +150,3 @@ apps/admin-ui/.expo/cache/*
# Local wrangler dev vars (may hold local-only secrets)
.dev.vars
apps/*/.dev.vars
**/store-screenshots/

View file

@ -7,6 +7,7 @@
"icon": "./assets/images/symbuyoteadmin.png",
"scheme": "freshyoadmin",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"supportsTablet": true,
"bundleIdentifier": "in.freshyo.adminui",
@ -61,9 +62,10 @@
"foregroundImage": "./assets/images/symbuyoteadmin.png",
"backgroundColor": "#fff0f6"
},
"package": "in.freshyo.adminui",
"googleServicesFile": "./google-services.json",
"intentFilters": [
"edgeToEdgeEnabled": true,
"package": "in.freshyo.adminui",
"googleServicesFile": "./google-services.json",
"intentFilters": [
{
"action": "VIEW",
"autoVerify": true,
@ -74,10 +76,7 @@
"pathPrefix": "/manage-orders/order-details"
}
],
"category": [
"BROWSABLE",
"DEFAULT"
]
"category": ["BROWSABLE", "DEFAULT"]
}
]
},
@ -97,9 +96,9 @@
"backgroundColor": "#ffffff"
}
],
"expo-secure-store",
"expo-notifications"
],
"expo-secure-store",
"expo-notifications"
],
"experiments": {
"typedRoutes": true
},

View file

@ -1,4 +1,5 @@
import { Drawer, DrawerContentScrollView, DrawerItem } from "expo-router/drawer";
import { Drawer } from "expo-router/drawer";
import { DrawerContentScrollView, DrawerItem } from "@react-navigation/drawer";
import { useRouter, Redirect } from "expo-router";
import {
TouchableOpacity,
@ -75,91 +76,91 @@ function CustomDrawerContent() {
label="Dashboard"
onPress={() => router.dismissTo("/(drawer)/dashboard" as any)}
icon={({ color, size }) => (
<MaterialIcons name="dashboard" size={size} color={color as string} />
<MaterialIcons name="dashboard" size={size} color={color} />
)}
/>
<DrawerItem
label="Products"
onPress={() => router.push("/(drawer)/dashboard/products" as any)}
icon={({ color, size }) => (
<MaterialIcons name="inventory" size={size} color={color as string} />
<MaterialIcons name="inventory" size={size} color={color} />
)}
/>
<DrawerItem
label="Prices Overview"
onPress={() => router.push("/(drawer)/dashboard/prices-overview" as any)}
icon={({ color, size }) => (
<MaterialIcons name="attach-money" size={size} color={color as string} />
<MaterialIcons name="attach-money" size={size} color={color} />
)}
/>
<DrawerItem
label="Product Groupings"
onPress={() => router.push("/(drawer)/dashboard/product-groupings" as any)}
icon={({ color, size }) => (
<MaterialIcons name="group-work" size={size} color={color as string} />
<MaterialIcons name="group-work" size={size} color={color} />
)}
/>
<DrawerItem
label="Dashboard Banners"
onPress={() => router.push("/(drawer)/dashboard/dashboard-banners" as any)}
icon={({ color, size }) => (
<MaterialIcons name="view-carousel" size={size} color={color as string} />
<MaterialIcons name="view-carousel" size={size} color={color} />
)}
/>
<DrawerItem
label="Slots"
onPress={() => router.push("/(drawer)/dashboard/slots" as any)}
icon={({ color, size }) => (
<MaterialIcons name="schedule" size={size} color={color as string} />
<MaterialIcons name="schedule" size={size} color={color} />
)}
/>
<DrawerItem
label="Complaints"
onPress={() => router.push("/(drawer)/dashboard/complaints" as any)}
icon={({ color, size }) => (
<MaterialIcons name="report-problem" size={size} color={color as string} />
<MaterialIcons name="report-problem" size={size} color={color} />
)}
/>
<DrawerItem
label="Manage Orders"
onPress={() => router.push("/(drawer)/dashboard/manage-orders" as any)}
icon={({ color, size }) => (
<MaterialIcons name="shopping-bag" size={size} color={color as string} />
<MaterialIcons name="shopping-bag" size={size} color={color} />
)}
/>
<DrawerItem
label="Coupons"
onPress={() => router.push("/(drawer)/dashboard/coupons" as any)}
icon={({ color, size }) => (
<MaterialIcons name="local-offer" size={size} color={color as string} />
<MaterialIcons name="local-offer" size={size} color={color} />
)}
/>
<DrawerItem
label="Stores"
onPress={() => router.push("/(drawer)/dashboard/stores" as any)}
icon={({ color, size }) => (
<MaterialIcons name="store" size={size} color={color as string} />
<MaterialIcons name="store" size={size} color={color} />
)}
/>
<DrawerItem
label="User Management"
onPress={() => router.push("/(drawer)/dashboard/user-management" as any)}
icon={({ color, size }) => (
<MaterialIcons name="people" size={size} color={color as string} />
<MaterialIcons name="people" size={size} color={color} />
)}
/>
<DrawerItem
label="Send Notifications"
onPress={() => router.push("/(drawer)/dashboard/send-notifications" as any)}
icon={({ color, size }) => (
<MaterialIcons name="campaign" size={size} color={color as string} />
<MaterialIcons name="campaign" size={size} color={color} />
)}
/>
<DrawerItem
label="Logout"
onPress={() => logout()}
icon={({ color, size }) => (
<MaterialIcons name="logout" size={size} color={color as string} />
<MaterialIcons name="logout" size={size} color={color} />
)}
/>
</DrawerContentScrollView>

View file

@ -234,7 +234,7 @@ export default function Complaints() {
<ActivityIndicator size="small" color="#3B82F6" />
<MyText style={tw`text-gray-500 ml-2`}>Loading more...</MyText>
</View>
) : undefined
) : null
}
/>
<ConfirmationDialog

View file

@ -140,7 +140,7 @@ export default function CouponDetails() {
<ScrollView
style={tw`flex-1`}
contentContainerStyle={tw`p-4 pb-10`}
refreshControl={<RefreshControl refreshing={isFetching} onRefresh={() => { void refetch() }} />}
refreshControl={<RefreshControl refreshing={isFetching} onRefresh={refetch} />}
>
<View style={tw`bg-white rounded-2xl p-5 mb-4 shadow-sm`}>
<View style={tw`flex-row items-center flex-wrap`}>

View file

@ -1,7 +1,7 @@
import { View, TouchableOpacity, Alert } from 'react-native';
import { MyText, BottomDropdown, tw, MyFlatList, useMarkDataFetchers } from 'common-ui';
import { useRouter, useFocusEffect } from 'expo-router';
import { useRouter } from 'expo-router';
import { useFocusEffect } from '@react-navigation/native';
import dayjs from 'dayjs';
import { useState, useCallback } from 'react';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';

View file

@ -556,7 +556,7 @@ export default function Orders() {
<ActivityIndicator size="small" color="#3B82F6" />
<MyText style={tw`text-gray-600 ml-2`}>Loading more...</MyText>
</View>
) : undefined
) : null
),
[isFetchingNextPage]
);

View file

@ -173,7 +173,7 @@ export default function Stores() {
numColumns={2}
columnWrapperStyle={tw`justify-start`}
contentContainerStyle={tw`p-2 pb-24`}
refreshControl={<RefreshControl refreshing={isLoading} onRefresh={() => { void refetch() }} />}
refreshControl={<RefreshControl refreshing={isLoading} onRefresh={refetch} />}
ListHeaderComponent={
<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 file

@ -1,12 +1,7 @@
import { QueryClientProvider } from "@tanstack/react-query";
import queryClient from "../utils/queryClient";
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 { useEffect } from "react";
import { StaffAuthProvider } from "@/components/context/staff-auth-context";
import { trpc, trpcClient } from "@/src/trpc-client";
import { SafeAreaView } from "react-native-safe-area-context";
@ -22,33 +17,21 @@ if (__DEV__) {
LogBox.ignoreAllLogs(true);
}
SplashScreen.preventAutoHideAsync();
export default function Layout() {
const [fontsLoaded, fontError] = useFonts(INTER_FONTS);
useEffect(() => {
if (fontsLoaded || fontError) SplashScreen.hideAsync();
}, [fontsLoaded, fontError]);
if (!fontsLoaded && !fontError) return null;
return (
<QueryClientProvider client={queryClient}>
<trpc.Provider client={trpcClient} queryClient={queryClient}>
<StaffAuthProvider>
<NotificationProvider>
<PaperProvider theme={PAPER_THEME}>
<SafeAreaView
edges={['left', 'right', 'bottom']}
style={{ flex: 1, backgroundColor: '#fff' }}
testID="app-root"
>
<RefreshProvider queryClient={queryClient}>
<Stack screenOptions={{ headerShown: false }} />
</RefreshProvider>
</SafeAreaView>
</PaperProvider>
<SafeAreaView
edges={['left', 'right', 'bottom']}
style={{ flex: 1, backgroundColor: '#fff' }}
testID="app-root"
>
<RefreshProvider queryClient={queryClient}>
<Stack screenOptions={{ headerShown: false }} />
</RefreshProvider>
</SafeAreaView>
<NotifChecker />
<Toast />
</NotificationProvider>

View file

@ -17,9 +17,8 @@ config.resolver.nodeModulesPaths = [
path.resolve(workspaceRoot, 'node_modules'),
];
// 3. Keep Metro's default hierarchical lookup: forcing it off breaks packages
// 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).
// 3. Force Metro to resolve (sub)dependencies only from the top-level `node_modules`
config.resolver.disableHierarchicalLookup = true;
// 4. Ensure Metro correctly resolves the entry point for expo-router
// This is crucial for web builds in a monorepo with expo-router

View file

@ -14,64 +14,76 @@
"test:typecheck": "tsc --noEmit --project tsconfig.json"
},
"dependencies": {
"@expo/vector-icons": "^15.0.2",
"@react-native-community/datetimepicker": "9.2.1",
"@expo/vector-icons": "^14.1.0",
"@react-native-community/datetimepicker": "8.4.1",
"@react-native-picker/picker": "2.11.1",
"@react-navigation/bottom-tabs": "^7.3.10",
"@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",
"@tanstack/react-query": "^5.100.0",
"@trpc/client": "^11.6.0",
"@trpc/react-query": "^11.6.0",
"axios": "^1.11.0",
"buffer": "^6.0.3",
"date-fns": "^4.1.0",
"dayjs": "^1.11.18",
"expo": "~58.0.26",
"expo-blur": "~58.0.6",
"expo-constants": "~58.0.16",
"expo-device": "~58.0.5",
"expo-document-picker": "~58.0.5",
"expo-font": "~58.0.12",
"expo-image": "~58.0.18",
"expo-image-picker": "~58.0.10",
"expo-linear-gradient": "~58.0.4",
"expo-linking": "~58.0.17",
"expo-location": "~58.0.22",
"expo-notifications": "~58.1.9",
"expo-router": "~58.0.32",
"expo-secure-store": "~58.0.3",
"expo-splash-screen": "~58.0.14",
"expo-status-bar": "~58.0.5",
"expo-system-ui": "~58.0.7",
"expo-updates": "~58.0.22",
"expo": "~53.0.22",
"expo-blur": "~14.1.5",
"expo-constants": "~17.1.7",
"expo-device": "~7.1.4",
"expo-document-picker": "~13.1.6",
"expo-font": "~13.3.2",
"expo-haptics": "~14.1.4",
"expo-image": "~2.4.0",
"expo-image-picker": "~16.1.4",
"expo-linear-gradient": "~14.1.5",
"expo-linking": "~7.1.7",
"expo-location": "^19.0.8",
"expo-notifications": "~0.31.4",
"expo-router": "~5.1.5",
"expo-secure-store": "~14.2.4",
"expo-splash-screen": "~0.30.10",
"expo-status-bar": "~2.2.3",
"expo-symbols": "~0.4.5",
"expo-system-ui": "~5.0.11",
"expo-updates": "~0.28.17",
"expo-web-browser": "~14.2.0",
"formik": "^2.4.6",
"react": "19.3.0",
"react-dom": "19.3.0",
"react-native": "0.88.1",
"jwt-decode": "^4.0.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-hook-form": "^7.62.0",
"react-native": "0.79.6",
"react-native-draggable-flatlist": "^4.0.3",
"react-native-gesture-handler": "~3.3.0",
"react-native-pager-view": "9.0.7",
"react-native-element-dropdown": "^2.12.4",
"react-native-gesture-handler": "~2.24.0",
"react-native-pager-view": "6.7.1",
"react-native-paper": "^5.14.5",
"react-native-reanimated": "4.7.1",
"react-native-safe-area-context": "~5.11.1",
"react-native-screens": "~4.30.1",
"react-native-reanimated": "~3.17.4",
"react-native-safe-area-context": "5.4.0",
"react-native-screens": "~4.11.1",
"react-native-tab-view": "^4.1.3",
"react-native-toast-message": "^2.3.3",
"react-native-web": "~0.21.4",
"react-native-worklets": "0.13.0",
"react-native-web": "~0.20.0",
"react-native-webview": "13.13.5",
"twrnc": "^4.9.1",
"yup": "^1.7.0"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@testing-library/react-native": "^13",
"@types/jest": "30.0.0",
"@types/react": "~19.3.0",
"@types/react": "~19.0.10",
"@types/react-native-razorpay": "^2.2.6",
"babel-preset-expo": "~58.0.26",
"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"
"eslint-config-expo": "~9.2.0",
"typescript": "~5.8.3",
"@testing-library/react-native": "^13",
"@types/jest": "^29",
"babel-preset-expo": "~13.0.0",
"jest": "~29.7.0",
"jest-expo": "~53.0.0",
"react-test-renderer": "19.0.0"
},
"private": true
}

View file

@ -153,8 +153,14 @@ export const NotificationProvider: React.FC<ReactParentComponent> = ({
);
return () => {
notificationListener.current?.remove();
responseListener.current?.remove();
if (notificationListener.current) {
Notifications.removeNotificationSubscription(
notificationListener.current
);
}
if (responseListener.current) {
Notifications.removeNotificationSubscription(responseListener.current);
}
};
}, [openFromNotification]);

View file

@ -2,8 +2,7 @@ import React, { useState, useEffect } from 'react';
import { View, Text, TouchableOpacity, FlatList } from 'react-native';
import { Formik } from 'formik';
import * as Yup from 'yup';
import { MyTextInput, MyButton, tw, AppContainer , Checkbox, BottomDialog, MyText } from 'common-ui';
import DateTimePickerMod from 'common-ui/src/components/date-time-picker';
import { MyTextInput, MyButton, tw, AppContainer , DateTimePickerMod, Checkbox, BottomDialog, MyText } from 'common-ui';
import { trpc } from '../trpc-client';
import ProductsSelector from '@/components/ProductsSelector';
@ -491,7 +490,7 @@ export default function CouponForm({ onSubmit, isLoading, initialValues }: Coupo
}
}}
onEndReachedThreshold={0.5}
ListFooterComponent={isFetchingUsers ? <Text style={tw`text-center p-3`}>Loading...</Text> : undefined}
ListFooterComponent={isFetchingUsers ? <Text style={tw`text-center p-3`}>Loading...</Text> : null}
style={tw`max-h-60`}
/>
<TouchableOpacity

View file

@ -100,10 +100,10 @@ describe('Root layout (AROOT-01..09)', () => {
const view = renderLayout()
await flush()
expect(notificationsMock.__getListenerCounts()).toEqual({ received: 1, response: 1 })
expect(Notifications.removeNotificationSubscription).not.toHaveBeenCalled()
view.unmount()
expect(notificationsMock.__getListenerCounts()).toEqual({ received: 0, response: 0 })
expect(Notifications.removeNotificationSubscription).toHaveBeenCalledTimes(2)
})
it('AROOT-06: a tap that launched the app opens that order', async () => {

View file

@ -5,8 +5,7 @@
import React from 'react'
import { act } from '@testing-library/react-native'
import { fireEvent } from '@testing-library/react-native'
import { Checkbox } from 'common-ui'
import DateTimePickerMod from 'common-ui/src/components/date-time-picker'
import { Checkbox, DateTimePickerMod } from 'common-ui'
import CouponForm from '@/src/components/CouponForm'
import { renderWithProviders, flush } from '../helpers/test-utils'

View file

@ -49,11 +49,6 @@ export function __emitNotification(notification: any) {
receivedListeners.forEach((listener) => listener(notification))
}
export const __getListenerCounts = () => ({
received: receivedListeners.length,
response: responseListeners.length,
})
export function __emitResponse(response: any) {
responseListeners.forEach((listener) => listener(response))
}

View file

@ -54,7 +54,7 @@ async function renderBanners(banners = [banner()], options: { stateful?: boolean
}
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) {

View file

@ -343,7 +343,7 @@ describe('Coupons list (ACOUPUI-01..30)', () => {
const icon = view
.UNSAFE_getAllByType(MaterialCommunityIcons)
.find((node: any) => node.props.name === 'plus')
fireEvent.press(icon!)
fireEvent.press(icon)
expect(router.push).toHaveBeenCalledWith('/(drawer)/dashboard/coupons/create')
})

View file

@ -28,7 +28,7 @@ async function renderGroups(groups: any[] = [GROUP_1]) {
}
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) {

View file

@ -1,10 +0,0 @@
/**
* 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 {}

View file

@ -10,27 +10,11 @@
"@backend/*": [
"../backend/src/*"
],
"shared-types": [
"../shared-types"
],
"common-ui": [
"../../packages/ui"
],
"common-ui/*": [
"../../packages/ui/*"
]
"shared-types": ["../shared-types"],
"common-ui": ["../../packages/ui"],
"common-ui/*": ["../../packages/ui/*"]
},
"moduleSuffixes": [
".ios",
".android",
".native",
".web",
""
],
"types": [
"jest",
"node"
]
"moduleSuffixes": [".ios", ".android", ".native", ".web", ""]
},
"include": [
"**/*.ts",

View file

@ -67,27 +67,3 @@ tests/
.env
.env.*
!.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/

View file

@ -2,19 +2,16 @@
"expo": {
"name": "Freshyo",
"slug": "freshyo",
"version": "1.3.0",
"version": "1.2.0",
"orientation": "portrait",
"icon": "./assets/images/freshyo-logo.png",
"scheme": "freshyo",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"buildNumber": "1.1.0",
"supportsTablet": true,
"bundleIdentifier": "com.freshyotrial.app",
"associatedDomains": [
"applinks:www.freshyo.in",
"applinks:app.freshyo.in"
],
"infoPlist": {
"LSApplicationQueriesSchemes": [
"ppemerchantsdkv1",
@ -64,49 +61,14 @@
}
},
"android": {
"blockedPermissions": [
"android.permission.READ_MEDIA_IMAGES",
"android.permission.READ_MEDIA_VIDEO"
],
"softwareKeyboardLayoutMode": "resize",
"adaptiveIcon": {
"foregroundImage": "./assets/images/freshyo-logo.png",
"backgroundColor": "#fff0f6"
},
"edgeToEdgeEnabled": true,
"package": "in.freshyo.app",
"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": "/"
}
]
}
]
"googleServicesFile": "./google-services.json"
},
"web": {
"bundler": "metro",
@ -125,18 +87,7 @@
}
],
"expo-secure-store",
"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
}
]
"expo-notifications"
],
"experiments": {
"typedRoutes": true
@ -149,6 +100,7 @@
},
"runtimeVersion": {
"policy": "appVersion"
},
"updates": {
"url": "https://u.expo.dev/7f3e7611-f7a8-45f9-8a99-c2b1f6454d48"

View file

@ -22,7 +22,7 @@ function Login() {
const [resendCountdown, setResendCountdown] = useState(0);
const [otpCells, setOtpCells] = useState(['', '', '', '']);
const intervalRef = useRef<any | null>(null);
const inputRefs = useRef<(React.ComponentRef<typeof TextInput> | null)[]>([null, null, null, null]);
const inputRefs = useRef<(TextInput | null)[]>([null, null, null, null]);
// Terms and Conditions state
const [termsAccepted, setTermsAccepted] = useState(true);
@ -534,9 +534,7 @@ function Login() {
<View style={tw`mt-4`}>
<MyButton
testID="user-login-submit"
onPress={() => {
void handleSubmit(onSubmit)();
}}
onPress={handleSubmit(onSubmit)}
fillColor="brand600"
textColor="white1"
fullWidth

View file

@ -1,10 +1,10 @@
import React from 'react';
import { useRouter, useFocusEffect } from 'expo-router';
import { useRouter } from 'expo-router';
import { View, Alert } from 'react-native';
import { FlashDeliveryProducts } from '@/components/SlotSpecificView';
import FlashDeliveryNote from '@/components/FlashDeliveryNote';
import { useFlashNavigationStore } from '@/components/stores/flashNavigationStore';
import { useFocusEffect } from '@react-navigation/native';
import { useFlashCartStore } from '@/src/store/flashCartStore';
import { tw, BottomDialog, MyText, MyTouchableOpacity } from 'common-ui';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';

View file

@ -2,8 +2,7 @@ import React from 'react';
import { View, Linking, TouchableOpacity, ActivityIndicator } from 'react-native';
import { Image } from 'expo-image';
import { MyText, tw, useManualRefresh, MyFlatList, useMarkDataFetchers, theme, MyTouchableOpacity } from 'common-ui';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import Ionicons from '@expo/vector-icons/Ionicons';
import { MaterialIcons, Ionicons } from '@expo/vector-icons';
import { trpc } from '@/src/trpc-client';
import { useGetEssentialConsts } from '@/src/hooks/prominent-api-hooks';
import dayjs from 'dayjs';

View file

@ -1,8 +1,8 @@
import React, { useState, useCallback } from 'react';
import { View, ScrollView, Alert } from 'react-native';
import { AppContainer, MyText, tw, useMarkDataFetchers, MyTouchableOpacity, MyTextInput } from 'common-ui';
import { useLocalSearchParams, useRouter, useFocusEffect } from 'expo-router';
import { useLocalSearchParams, useRouter } from 'expo-router';
import { useFocusEffect } from '@react-navigation/native';
import { useAppStore } from '@/src/store/appStore';
import { trpc } from '@/src/trpc-client';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';

View file

@ -1,11 +1,11 @@
import React, { useState } from 'react';
import { View, ScrollView, Linking } from 'react-native';
import { useRouter, useFocusEffect } from 'expo-router';
import { useRouter } from 'expo-router';
import { useFocusEffect } from '@react-navigation/native';
import { AppContainer, MyText, tw, MyTouchableOpacity, ProfileImage, colors } from 'common-ui';
import TabLayoutWrapper from '@/components/TabLayoutWrapper';
import { LinearGradient } from 'expo-linear-gradient';
import Ionicons from '@expo/vector-icons/Ionicons';
import { Ionicons } from '@expo/vector-icons';
import NextOrderGlimpse from '@/components/NextOrderGlimpse';
import AddressSwitcherSheet from '@/src/components/location/AddressSwitcherSheet';
import { useRegion } from '@/src/hooks/useRegion';

View file

@ -1,8 +1,7 @@
import React, { useState, useCallback, useEffect } from 'react';
import { View, FlatList, Alert, ActivityIndicator } from 'react-native';
import { Image } from 'expo-image';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import Ionicons from '@expo/vector-icons/Ionicons';
import { MaterialIcons, Ionicons } from '@expo/vector-icons';
import { useRouter } from 'expo-router';
import { tw, useManualRefresh, MyText, MyFlatList, useMarkDataFetchers, MyTouchableOpacity, theme } from 'common-ui';

View file

@ -2,7 +2,7 @@ import React from 'react';
import { View, ScrollView } from 'react-native';
import { useRouter } from 'expo-router';
import { AppContainer, MyText, tw, MyTouchableOpacity } from 'common-ui';
import Ionicons from '@expo/vector-icons/Ionicons';
import { Ionicons } from '@expo/vector-icons';
import { TermsAndConditionsContent } from '@/components/TermsAndConditions';
export default function TermsAndConditions() {

View file

@ -15,7 +15,7 @@ import {
MyTouchableOpacity,
} from "common-ui";
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
import Ionicons from "@expo/vector-icons/Ionicons";
import { Ionicons } from "@expo/vector-icons";
import { useStores } from "@/src/hooks/prominent-api-hooks";
import { LinearGradient } from "expo-linear-gradient";
import TabLayoutWrapper from "@/components/TabLayoutWrapper";
@ -136,7 +136,7 @@ const StoreCard = ({
</MyTouchableOpacity>
<View style={tw`h-8`} />
</View>
) : undefined}
) : null}
/>
</View>

View file

@ -12,6 +12,7 @@ import {
MyText,
} from "common-ui";
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
import FontAwesome5 from "@expo/vector-icons/FontAwesome5";
import ProductCard from "@/components/ProductCard";
import FloatingCartBar from "@/components/floating-cart-bar";
import { useStoreHeaderStore } from "@/src/store/storeHeaderStore";
@ -160,7 +161,7 @@ export default function StoreDetail() {
<View
style={tw`w-16 h-16 bg-pink-50 rounded-full items-center justify-center mb-4`}
>
<MaterialIcons
<FontAwesome5
name="store"
size={28}
color={theme.colors.brand500}

View file

@ -6,7 +6,7 @@ import {
StatusBar,
} from "react-native";
import { LinearGradient } from "expo-linear-gradient";
import Ionicons from "@expo/vector-icons/Ionicons";
import { Ionicons } from "@expo/vector-icons";
import { useAuth } from "@/src/contexts/AuthContext";
import { tw, theme, MyTouchableOpacity, MyText } from "common-ui";
import HomeIcon from "@/components/icons/HomeIcon";
@ -58,7 +58,7 @@ export default function Layout() {
tabBarLabel: 'Home',
tabBarButtonTestID: 'tab-home',
tabBarIcon: ({ color, size, focused }) => (
<HomeIcon focused={focused} size={size} color={color as string} />
<HomeIcon focused={focused} size={size} color={color} />
),
}}
/>
@ -68,7 +68,7 @@ export default function Layout() {
tabBarLabel: 'Offers',
tabBarButtonTestID: 'tab-offers',
tabBarIcon: ({ color, size, focused }) => (
<OffersIcon focused={focused} size={size} color={color as string} />
<OffersIcon focused={focused} size={size} color={color} />
),
}}
/>
@ -105,7 +105,7 @@ export default function Layout() {
tabBarLabel: 'Stores',
tabBarButtonTestID: 'tab-stores',
tabBarIcon: ({ color, size, focused }) => (
<StoresIcon focused={focused} size={size} color={color as string} />
<StoresIcon focused={focused} size={size} color={color} />
),
}}
/>
@ -115,7 +115,7 @@ export default function Layout() {
tabBarLabel: 'Me',
tabBarButtonTestID: 'tab-me',
tabBarIcon: ({ color, size, focused }) => (
<MeIcon focused={focused} size={size} color={color as string} />
<MeIcon focused={focused} size={size} color={color} />
),
}}
/>

View file

@ -1,17 +1,20 @@
import { Stack, DarkTheme, DefaultTheme, ThemeProvider } from "expo-router";
import {
DarkTheme,
DefaultTheme,
ThemeProvider,
} from "@react-navigation/native";
import { useFonts } from "expo-font";
import { Stack } from "expo-router";
import "react-native-reanimated";
import { useColorScheme } from "@/hooks/useColorScheme";
import { Appearance, StatusBar, View, LogBox } from "react-native";
import { QueryClientProvider } from "@tanstack/react-query";
import { theme , MyStatusBar, INTER_FONTS, PAPER_THEME } from "common-ui";
import { theme , MyStatusBar } from "common-ui";
import queryClient from "@/utils/queryClient";
import Toast from "react-native-toast-message";
import { NotificationProvider } from "@/services/notif-service/notif-context";
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 { trpc, trpcClient } from "@/src/trpc-client";
import { SafeAreaView, SafeAreaProvider } from "react-native-safe-area-context";
@ -39,23 +42,19 @@ if (__DEV__) {
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() {
const colorScheme = useColorScheme();
const [fontsLoaded, fontError] = useFonts(INTER_FONTS);
const [loaded] = useFonts({
SpaceMono: require("../assets/fonts/SpaceMono-Regular.ttf"),
});
React.useEffect(() => {
Appearance.setColorScheme('light')
}, []);
React.useEffect(() => {
if (fontsLoaded || fontError) SplashScreen.hideAsync();
}, [fontsLoaded, fontError]);
if (!fontsLoaded && !fontError) return null;
if (!loaded) {
return null;
}
return (
<GestureHandlerRootView style={{ flex: 1 }}>
@ -81,7 +80,7 @@ export default function RootLayout() {
<NotificationProvider>
<NotifChecker />
<NotifRegionSync />
<PaperProvider theme={PAPER_THEME}>
<PaperProvider>
<RefreshProvider queryClient={queryClient}>
<CentralStoreInitializer>
<ImageCacheTtl />

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 KiB

View file

@ -1,5 +1,5 @@
import React, { useState, useEffect, useRef } from 'react';
import { View, TouchableOpacity, ScrollView, Alert, NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
import { View, Text, TouchableOpacity, ScrollView, Alert, NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
import { useRouter } from 'expo-router';
import { tw, BottomDialog, RawBottomDialog, MyText } from 'common-ui';
import { useQueryClient } from '@tanstack/react-query';
@ -30,7 +30,7 @@ const CheckoutAddressSelector: React.FC<AddressSelectorProps> = ({
const queryClient = useQueryClient();
const utils = trpc.useUtils();
const router = useRouter();
const scrollViewRef = useRef<React.ComponentRef<typeof ScrollView>>(null);
const scrollViewRef = useRef<ScrollView>(null);
const { isAuthenticated } = useAuth();
const { regionId: selectedRegionId } = useRegion();
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" />
</View>
<MyText style={tw`text-base font-bold text-gray-900`}>
<Text style={tw`text-base font-bold text-gray-900`}>
Delivery Address
</MyText>
</Text>
</View>
<TouchableOpacity testID="add-new-address" onPress={() => setShowAddAddress(true)}>
<MyText style={tw`text-brand500 font-bold text-sm`}>+ Add New</MyText>
<Text style={tw`text-brand500 font-bold text-sm`}>+ Add New</Text>
</TouchableOpacity>
</View>
{(!sortedAddresses || sortedAddresses.length === 0) ? (
<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" />
<MyText style={tw`text-gray-500 mt-2`}>No addresses found</MyText>
<Text style={tw`text-gray-500 mt-2`}>No addresses found</Text>
<TouchableOpacity testID="add-address-empty" onPress={() => setShowAddAddress(true)} style={tw`mt-3 bg-brand500 px-4 py-2 rounded-lg`}>
<MyText style={tw`text-white font-bold text-sm`}>Add Address</MyText>
<Text style={tw`text-white font-bold text-sm`}>Add Address</Text>
</TouchableOpacity>
</View>
) : (
@ -221,9 +221,9 @@ const CheckoutAddressSelector: React.FC<AddressSelectorProps> = ({
size={20}
color={selectedAddress === address.id ? '#EC4899' : '#6B7280'}
/>
<MyText style={tw`font-bold ml-2 ${selectedAddress === address.id ? 'text-brand500' : 'text-gray-900'}`}>
<Text style={tw`font-bold ml-2 ${selectedAddress === address.id ? 'text-brand500' : 'text-gray-900'}`}>
{address.name}
</MyText>
</Text>
</View>
{selectedAddress === address.id && (
<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>
<MyText style={tw`text-gray-600 text-sm leading-5 mb-1`} numberOfLines={2}>
<Text style={tw`text-gray-600 text-sm leading-5 mb-1`} numberOfLines={2}>
{address.addressLine1}{address.addressLine2 ? `, ${address.addressLine2}` : ''}
</MyText>
<MyText style={tw`text-gray-600 text-sm mb-1`}>
</Text>
<Text style={tw`text-gray-600 text-sm mb-1`}>
{address.city}, {address.state}
</MyText>
<MyText style={tw`text-gray-500 text-xs mt-2`}>
</Text>
<Text style={tw`text-gray-500 text-xs mt-2`}>
Phone: {address.phone}
</MyText>
</Text>
</TouchableOpacity>
))}
</ScrollView>
@ -274,9 +274,9 @@ const CheckoutAddressSelector: React.FC<AddressSelectorProps> = ({
disabled={locationLoading && editingLocationAddressId === selectedAddr.id}
style={tw`mt-2 py-2 px-3 bg-blue-50 rounded-lg self-start`}
>
<MyText style={tw`text-blue-600 text-sm font-bold`}>
<Text style={tw`text-blue-600 text-sm font-bold`}>
{locationLoading && editingLocationAddressId === selectedAddr.id ? 'Attaching...' : '+ Attach Current Location'}
</MyText>
</Text>
</TouchableOpacity>
</>
) : null;

View file

@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { View, TextInput, ActivityIndicator, Alert } from 'react-native';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';import { MyText, ImageUploaderNeo, tw, MyTouchableOpacity, type ImageUploaderNeoItem, type ImageUploaderNeoPayload } from 'common-ui'
import { MaterialIcons } from '@expo/vector-icons'
import { MyText, ImageUploaderNeo, tw, MyTouchableOpacity, type ImageUploaderNeoItem, type ImageUploaderNeoPayload } from 'common-ui'
import { trpc } from '@/src/trpc-client'
import { useUploadToObjectStorage } from '../hooks/useUploadToObjectStore'
import type { ComplaintFormProps } from '@packages/shared'

View file

@ -5,7 +5,7 @@ import { View, TouchableOpacity, ActivityIndicator, Linking, ScrollView, Dimensi
import { useRouter } from 'expo-router';
import { tw, MyText } from 'common-ui';
import { useNavigationTarget } from 'common-ui/hooks/useNavigationTarget';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import { MaterialIcons } from '@expo/vector-icons';
import dayjs from 'dayjs';
import { trpc } from '@/src/trpc-client';
import { orderStatusManipulator } from '@/src/lib/string-manipulators';
@ -124,7 +124,7 @@ export default function NextOrderGlimpse() {
const { setNavigationTarget } = useNavigationTarget();
const userDetails = useUserDetails();
const [currentIndex, setCurrentIndex] = useState(0);
const scrollViewRef = useRef<React.ComponentRef<typeof ScrollView>>(null);
const scrollViewRef = useRef<ScrollView>(null);
const { data: ordersData, isLoading: ordersLoading } = trpc.user.order.getOrders.useQuery({
page: 1,

View file

@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { View, Alert, TextInput, ActivityIndicator } from 'react-native';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import Ionicons from '@expo/vector-icons/Ionicons';
import { MaterialIcons, Ionicons } from '@expo/vector-icons';
import { tw, MyText, MyTouchableOpacity, BottomDialog } from 'common-ui';
import { trpc } from '@/src/trpc-client';
import ComplaintForm from '@/components/ComplaintForm';

View file

@ -10,6 +10,7 @@ import { useRegion } from '@/src/hooks/useRegion';
import { useCheckoutStore } from '@/src/store/checkoutStore';
import { clearLocalCart } from '@/hooks/cart-query-hooks';
import { useQueryClient } from '@tanstack/react-query';
import { FontAwesome5, FontAwesome6 } from '@expo/vector-icons';
interface PaymentAndOrderProps {
selectedAddress: number | null;
@ -215,7 +216,7 @@ const PaymentAndOrderComponent: React.FC<PaymentAndOrderProps> = ({
<View style={tw`w-2.5 h-2.5 rounded-full bg-brand500`} />
</View>
<View style={tw`w-10 h-10 bg-green-50 rounded-full items-center justify-center mr-3`}>
<MaterialIcons name="currency-rupee" size={20} color="#10B981" />
<FontAwesome5 name="rupee-sign" size={20} color="#10B981" />
</View>
<View>
<MyText style={tw`font-bold text-gray-900`}>Cash on Delivery</MyText>
@ -225,11 +226,11 @@ const PaymentAndOrderComponent: React.FC<PaymentAndOrderProps> = ({
<View style={tw`mt-3 flex-row items-center gap-4`}>
<View style={tw`flex-row items-center`}>
<MaterialIcons name="account-balance-wallet" size={12} color="#663399" style={tw`mr-1.5`} />
<FontAwesome6 name="wallet" size={12} color="#663399" style={tw`mr-1.5`} />
<MyText style={tw`text-xs text-gray-500`}>UPI accepted during COD</MyText>
</View>
<View style={tw`flex-row items-center`}>
<MaterialIcons name="payments" size={12} color="#10B981" style={tw`mr-1.5`} />
<FontAwesome5 name="money-bill-wave" size={12} color="#10B981" style={tw`mr-1.5`} />
<MyText style={tw`text-xs text-gray-500`}>Cash payment</MyText>
</View>
</View>

View file

@ -8,6 +8,7 @@ import usePickImage from 'common-ui/src/components/use-pick-image';
import { theme } from 'common-ui/src/theme';
import dayjs from 'dayjs';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import FontAwesome5 from '@expo/vector-icons/FontAwesome5';
import { trpc, trpcClient } from '@/src/trpc-client';
import { useAddToCart, useGetCart, useUpdateCartItem, useRemoveFromCart } from '@/hooks/cart-query-hooks';
import { useProductSlotIdentifier } from '@/hooks/useProductSlotIdentifier';
@ -527,7 +528,7 @@ const ProductDetail: React.FC<ProductDetailProps> = ({ productId, isFlashDeliver
{productDetail.store && (
<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`}>
<MaterialIcons name="store" size={16} color="#4B5563" />
<FontAwesome5 name="store" size={16} color="#4B5563" />
</View>
<View>
<MyText style={tw`text-xs text-gray-500 uppercase font-bold`}>Sourced From</MyText>
@ -667,7 +668,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>
</View>
}
ListFooterComponent={reviewsLoading ? <View style={tw`py-4`}><MyText style={tw`text-center text-gray-400 text-xs`}>Loading more reviews...</MyText></View> : undefined}
ListFooterComponent={reviewsLoading ? <View style={tw`py-4`}><MyText style={tw`text-center text-gray-400 text-xs`}>Loading more reviews...</MyText></View> : null}
scrollEnabled={false}
/>
</View>

View file

@ -1,5 +1,6 @@
import React, { useState } from 'react';
import { Drawer } from 'expo-router/drawer';
import { DrawerContentComponentProps } from '@react-navigation/drawer';
import { View, ScrollView, Alert, Dimensions, RefreshControl } from 'react-native';
import { Image } from 'expo-image';
import { useRouter, usePathname, Slot } from 'expo-router';
@ -30,9 +31,7 @@ interface SlotLayoutProps extends SlotProductsProps {
isForFlashDelivery?: boolean;
}
type DrawerContentProps = Parameters<NonNullable<React.ComponentProps<typeof Drawer>['drawerContent']>>[0];
function CustomDrawerContent(baseUrl: string, drawerProps: DrawerContentProps, slotIdParent?: number, storeIdParent?: number) {
function CustomDrawerContent(baseUrl: string, drawerProps: DrawerContentComponentProps, slotIdParent?: number, storeIdParent?: number) {
const router = useRouter();
const pathname = usePathname();
const { data: storesData } = useStores();
@ -537,7 +536,7 @@ export function SlotProducts({ slotId:slotIdParent, storeId:storeIdParent, baseU
<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>
</View>
) : undefined
) : null
}
/>
</View>

View file

@ -426,9 +426,7 @@ function RegistrationForm({ onSubmit, isLoading = false, initialValues, isEdit =
<MyButton
testID="registration-submit-button"
onPress={() => {
void handleSubmit(handleFormSubmit)();
}}
onPress={handleSubmit(handleFormSubmit)}
fillColor="brand500"
textColor="white1"
fullWidth

View file

@ -1,6 +1,6 @@
import { useFocusEffect } from '@react-navigation/native';
import type { AuthRedirectOptions } from '@packages/shared'
import { useRouter, useFocusEffect } from 'expo-router';
import { useRouter } from 'expo-router';
import { useAuth } from '@/src/contexts/AuthContext';
import type { RedirectState } from '@/src/contexts/AuthContext';
import { StorageServiceCasual } from 'common-ui';

View file

@ -30,19 +30,4 @@ config.resolver.blockList = [
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;

View file

@ -14,87 +14,77 @@
"test:typecheck": "tsc --noEmit --project tsconfig.json"
},
"dependencies": {
"@expo/vector-icons": "^15.0.2",
"@react-native-async-storage/async-storage": "2.2.0",
"@react-native-community/datetimepicker": "9.2.1",
"@react-native-community/netinfo": "12.0.1",
"@react-native-community/slider": "5.2.1",
"@expo/vector-icons": "^14.1.0",
"@react-native-community/datetimepicker": "8.4.1",
"@react-native-google-signin/google-signin": "^16.0.0",
"@react-native-picker/picker": "2.11.1",
"@react-navigation/bottom-tabs": "^7.3.10",
"@react-navigation/drawer": "^7.3.9",
"@react-navigation/elements": "^2.3.8",
"@react-navigation/native": "^7.1.6",
"@shopify/flash-list": "2.3.2",
"@tanstack/react-query": "^5.100.0",
"@trpc/client": "^11.6.0",
"@trpc/react-query": "^11.6.0",
"axios": "^1.11.0",
"dayjs": "^1.11.18",
"expo": "~58.0.26",
"expo-application": "~58.1.2",
"expo-blur": "~58.0.6",
"expo-camera": "~58.0.14",
"expo-clipboard": "~58.0.4",
"expo-constants": "~58.0.16",
"expo-crypto": "~58.0.8",
"expo-device": "~58.0.5",
"expo-document-picker": "~58.0.5",
"expo-font": "~58.0.12",
"expo-haptics": "~58.0.8",
"expo-image": "~58.0.18",
"expo-image-picker": "~58.0.10",
"expo-linear-gradient": "~58.0.4",
"expo-linking": "~58.0.17",
"expo-location": "~58.0.22",
"expo-notifications": "~58.1.9",
"expo-print": "~58.0.9",
"expo-router": "~58.0.32",
"expo-screen-capture": "~58.0.6",
"expo-screen-orientation": "~58.0.4",
"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",
"expo": "~53.0.22",
"expo-blur": "~14.1.5",
"expo-constants": "~17.1.7",
"expo-crypto": "~14.1.5",
"expo-device": "~7.1.4",
"expo-document-picker": "~13.1.6",
"expo-font": "~13.3.2",
"expo-haptics": "~14.1.4",
"expo-image": "2.4.1",
"expo-image-picker": "~16.1.4",
"expo-linear-gradient": "~14.1.5",
"expo-linking": "~7.1.7",
"expo-location": "~18.1.6",
"expo-notifications": "~0.31.4",
"expo-router": "~5.1.5",
"expo-secure-store": "~14.2.4",
"expo-splash-screen": "~0.30.10",
"expo-status-bar": "~2.2.3",
"expo-symbols": "~0.4.5",
"expo-system-ui": "~5.0.11",
"expo-updates": "~0.28.17",
"expo-web-browser": "~14.2.0",
"formik": "^2.4.6",
"fuse.js": "^7.1.0",
"jwt-decode": "^4.0.0",
"react": "19.3.0",
"react-dom": "19.3.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-hook-form": "^7.62.0",
"react-native": "0.88.1",
"react-native-gesture-handler": "~3.3.0",
"react-native-keyboard-controller": "1.22.7",
"react-native-maps": "1.29.11",
"react-native-pager-view": "9.0.7",
"react-native": "0.79.6",
"react-native-element-dropdown": "^2.12.4",
"react-native-gesture-handler": "~2.24.0",
"react-native-pager-view": "6.7.1",
"react-native-paper": "^5.14.5",
"react-native-reanimated": "4.7.1",
"react-native-safe-area-context": "~5.11.1",
"react-native-screens": "~4.30.1",
"react-native-svg": "15.16.0",
"react-native-razorpay": "^2.3.1",
"react-native-reanimated": "~3.17.4",
"react-native-safe-area-context": "5.4.0",
"react-native-screens": "~4.11.1",
"react-native-svg": "15.11.2",
"react-native-tab-view": "^4.1.3",
"react-native-toast-message": "^2.3.3",
"react-native-view-shot": "6.1.1",
"react-native-web": "~0.21.4",
"react-native-webview": "14.0.1",
"react-native-worklets": "0.13.0",
"react-native-web": "~0.20.0",
"react-native-webview": "13.13.5",
"twrnc": "^4.9.1",
"yup": "^1.7.0"
},
"devDependencies": {
"@babel/core": "^7.29.7",
"@babel/core": "^7.25.2",
"@testing-library/react-native": "^13",
"@types/jest": "30.0.0",
"@types/react": "~19.3.0",
"babel-preset-expo": "~58.0.26",
"@types/jest": "^29",
"@types/react": "~19.0.10",
"@types/react-native-razorpay": "^2.2.6",
"babel-preset-expo": "~13.0.0",
"eslint": "^9.25.0",
"eslint-config-expo": "~58.0.4",
"jest": "~30.5.2",
"jest-expo": "~58.0.15",
"eslint-config-expo": "~9.2.0",
"jest": "~29.7.0",
"jest-expo": "~53.0.0",
"react-test-renderer": "19.0.0",
"typescript": "~6.0.3"
"typescript": "~5.8.3"
},
"private": true
}

View file

@ -89,8 +89,14 @@ export const NotificationProvider: React.FC<ReactParentComponent> = ({
});
return () => {
notificationListener.current?.remove();
responseListener.current?.remove();
if (notificationListener.current) {
Notifications.removeNotificationSubscription(
notificationListener.current
);
}
if (responseListener.current) {
Notifications.removeNotificationSubscription(responseListener.current);
}
};
}, []);

View file

@ -1,5 +1,5 @@
import * as React from 'react';
import { useFocusEffect } from 'expo-router';
import { useFocusEffect } from '@react-navigation/native';
import { useAppStore } from '@/src/store/appStore';
export const useHideTabNav = (caller: string = 'default') => {

View file

@ -1,4 +1,4 @@
import * as FileSystem from 'expo-file-system/legacy'
import * as FileSystem from 'expo-file-system'
import { IMAGE_CACHE_CLEARED_AT_KEY } from '@/src/lib/image-cache-ttl'
/**

View file

@ -146,7 +146,7 @@ describe('app entry + route layouts (APP-01..APP-24)', () => {
.UNSAFE_getAllByType(Tabs.Screen)
.find((screen: any) => screen.props.name === '(tabs)/flash-delivery')
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()

View file

@ -113,7 +113,7 @@ describe('Complaints (CMP-01..CMP-18)', () => {
beforeEach(() => {
resetAllMocks()
mockFocusCallbacks.clear()
jest.spyOn(Linking, 'openURL').mockResolvedValue(undefined as any)
jest.spyOn(Linking, 'openURL').mockResolvedValue(true)
})
it('CMP-01: shows loading copy while the complaints query is pending', () => {

View file

@ -1568,7 +1568,7 @@ describe('Home (HOME)', () => {
it('HOME-110: the support mobile renders and tapping it opens a tel: link', async () => {
signedIn()
setOrders([{ ...O1, deliveryStatus: 'processing' }])
const openURL = jest.spyOn(Linking, 'openURL').mockResolvedValue(undefined as any)
const openURL = jest.spyOn(Linking, 'openURL').mockResolvedValue(true)
const { getByText, getByTestId } = await renderHome()
expect(getByText('Need help? Call 8688182552')).toBeTruthy()

View file

@ -58,7 +58,7 @@ describe('Me layout (APP-20..APP-23 / ME-20)', () => {
(screen: any) => screen.props.name === '[id]'
)
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', () => {

View file

@ -1,10 +0,0 @@
/**
* 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 {}

View file

@ -39,11 +39,7 @@
".web",
""
],
"jsx": "react-native",
"types": [
"jest",
"node"
]
"jsx": "react-native"
},
"include": [
"**/*.ts",

Binary file not shown.

View file

@ -6,12 +6,10 @@
"dev": "vite dev",
"build": "vite build",
"build:dev": "CLOUDFLARE_ENV=dev vite build",
"build:app": "CLOUDFLARE_ENV=app vite build",
"preview": "npm run build && wrangler dev",
"typecheck": "tsc --noEmit",
"deploy": "npm run build && wrangler deploy",
"deploy:dev": "npm run build:dev && wrangler deploy",
"deploy:app": "npm run build:app && wrangler deploy",
"cf-typegen": "wrangler types"
},
"dependencies": {

View file

@ -1,10 +0,0 @@
[
{
"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"]
}
}
]

View file

@ -1,41 +0,0 @@
/**
* 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 }],
},
}
}

View file

@ -1,36 +0,0 @@
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)
},
}

View file

@ -5,7 +5,7 @@
"observability": {
"enabled": true
},
"main": "./src/server-entry.ts",
"main": "@tanstack/react-start/server-entry",
"compatibility_flags": [
"nodejs_compat"
],
@ -22,18 +22,6 @@
"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
}
]
}
}
}

3240
bun.lock

File diff suppressed because it is too large Load diff

View file

@ -1508,506 +1508,3 @@ case and smaller so it fits beside the 2xl figure).
(testID cart-item-coupon-price-{id})
- footer: standalone hint block under the subtotal row
+ 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.

View file

@ -27,20 +27,20 @@
"packages/*"
],
"devDependencies": {
"@babel/core": "^7.29.7",
"@babel/core": "^7.25.2",
"@playwright/test": "^1.63.0",
"@types/bun": "^1.4.4",
"@types/canvas-confetti": "^1.9.0",
"@types/node": "^22.10.2",
"@types/react": "~19.3.0",
"@types/react": "~19.0.10",
"@types/react-native-razorpay": "^2.2.6",
"eslint": "^9.25.0",
"eslint-config-expo": "~58.0.4",
"eslint-config-expo": "~9.2.0",
"turbo": "^2.0.0",
"typescript": "~6.0.3"
"typescript": "~5.8.3"
},
"dependencies": {
"@react-native/virtualized-lists": "^0.88.1",
"@react-native/virtualized-lists": "^0.79.6",
"@react-three/drei": "^10.7.7",
"@react-three/fiber": "^9.5.0",
"@types/three": "^0.182.0",
@ -48,16 +48,16 @@
"backend": "^1.0.0",
"canvas-confetti": "^1.9.4",
"drizzle-orm": "^0.45.1",
"expo": "~58.0.26",
"expo-auth-session": "~58.0.19",
"expo-crypto": "~58.0.8",
"expo": "~53.0.22",
"expo-auth-session": "~6.2.1",
"expo-crypto": "~14.1.5",
"expo-server-sdk": "^5.0.0",
"expo-web-browser": "~58.1.0",
"expo-web-browser": "~14.2.0",
"fuse.js": "^7.1.0",
"node-cron": "^4.2.1",
"pg": "^8.20.0",
"react": "19.3.0",
"react-native": "0.88.1",
"react": "19.0.0",
"react-native": "0.79.6",
"three": "^0.182.0",
"user-ui": "^1.0.0",
"zustand": "^5.0.9"

View file

@ -1,6 +1,6 @@
import { DependencyList, useEffect } from 'react';
import { DeviceEventEmitter } from 'react-native';
import { useFocusEffect } from 'expo-router';
import { useFocusEffect } from '@react-navigation/native';
export function useDrawerTitle(title: string, deps: DependencyList) {
useFocusEffect(() => {

View file

@ -1,4 +1,4 @@
import { useFocusEffect } from 'expo-router';
import { useFocusEffect } from '@react-navigation/native';
import { useCallback } from 'react';
/**

View file

@ -1,5 +1,5 @@
import { useCallback, useRef } from 'react';
import { useFocusEffect } from 'expo-router';
import { useFocusEffect } from '@react-navigation/native';
export const useMarkDataFetchers = (callback: () => void) => {
// The callback is held in a ref: call sites pass inline arrows, so putting it in the

View file

@ -11,6 +11,7 @@ import { useTheme, Theme } from "./hooks/theme-context";
import MyTextInput from "./src/components/textinput";
import BottomDialog, { ConfirmationDialog, RawBottomDialog } from "./src/components/dialog";
import LoadingDialog from "./src/components/loading-dialog";
import DatePicker from "./src/components/date-picker";
import MyText from "./src/components/text";
import MyTouchableOpacity from "./src/components/touchable-opacity";
import BottomDropdown from "./src/components/bottom-dropdown";
@ -31,12 +32,11 @@ import useManualRefresh from "./hooks/useManualRefresh";
import { useDrawerTitle } from "./hooks/useDrawerTitle";
import { useMarkDataFetchers } from "./hooks/useMarkDataFetchers";
import { StorageServiceCasual } from "./src/services/StorageServiceCasual";
import DateTimePickerMod from "./src/components/date-time-picker";
import { RefreshProvider, useRefresh } from "./src/lib/refresh-context";
import MyStatusBar from "./src/components/MyStatusBar";
import { InfoDialog } from "./src/components/info-dialog";
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";
@ -56,6 +56,7 @@ export {
MyTouchableOpacity,
ConfirmationDialog,
RawBottomDialog,
DatePicker,
BottomDropdown,
ImageViewerURI,
ImageCarousel,
@ -76,14 +77,11 @@ export {
useDrawerTitle,
useMarkDataFetchers,
StorageServiceCasual,
DateTimePickerMod,
RefreshProvider,
useRefresh,
MyStatusBar,
InfoDialog,
updateStatusBarColor,
useStatusBarStore,
INTER_FONTS,
interFamilyFor,
InterFamily,
PAPER_THEME,
};

View file

@ -4,50 +4,58 @@
"main": "index.ts",
"private": true,
"dependencies": {
"@expo-google-fonts/inter": "^0.4.2",
"@expo/vector-icons": "^15.0.2",
"@react-native-community/datetimepicker": "9.2.1",
"@expo/vector-icons": "^14.1.0",
"@react-native-community/datetimepicker": "8.4.1",
"@react-native-google-signin/google-signin": "^16.0.0",
"@react-native-picker/picker": "2.11.1",
"@react-navigation/bottom-tabs": "^7.3.10",
"@react-navigation/drawer": "^7.5.8",
"@react-navigation/elements": "^2.3.8",
"@react-navigation/native": "^7.1.6",
"@tanstack/react-query": "^5.100.0",
"axios": "^1.11.0",
"buffer": "^6.0.3",
"dayjs": "^1.11.18",
"expo": "~58.0.26",
"expo-blur": "~58.0.6",
"expo-constants": "~58.0.16",
"expo-dev-client": "~58.0.21",
"expo-device": "~58.0.5",
"expo-document-picker": "~58.0.5",
"expo-font": "~58.0.12",
"expo-image": "~58.0.18",
"expo-image-picker": "~58.0.10",
"expo-linear-gradient": "~58.0.4",
"expo-linking": "~58.0.17",
"expo-notifications": "~58.1.9",
"expo-router": "~58.0.32",
"expo-secure-store": "~58.0.3",
"expo-splash-screen": "~58.0.14",
"expo-status-bar": "~58.0.5",
"expo-system-ui": "~58.0.7",
"expo-web-browser": "~58.1.0",
"expo": "~53.0.22",
"expo-blur": "~14.1.5",
"expo-constants": "~17.1.7",
"expo-dev-client": "~5.2.4",
"expo-device": "~7.1.4",
"expo-document-picker": "~13.1.6",
"expo-font": "~13.3.2",
"expo-haptics": "~14.1.4",
"expo-image": "~2.4.0",
"expo-image-picker": "~16.1.4",
"expo-linear-gradient": "~14.1.5",
"expo-linking": "~7.1.7",
"expo-notifications": "~0.31.4",
"expo-router": "~5.1.5",
"expo-secure-store": "~14.2.4",
"expo-splash-screen": "~0.30.10",
"expo-status-bar": "~2.2.3",
"expo-symbols": "~0.4.5",
"expo-system-ui": "~5.0.11",
"expo-web-browser": "~14.2.0",
"formik": "^2.4.6",
"jwt-decode": "^4.0.0",
"react": "19.3.0",
"react-dom": "19.3.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-hook-form": "^7.62.0",
"react-native": "0.88.1",
"react-native-gesture-handler": "~3.3.0",
"react-native": "0.79.6",
"react-native-element-dropdown": "^2.12.4",
"react-native-gesture-handler": "~2.24.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-pager-view": "^6.9.1",
"react-native-paper": "^5.14.5",
"react-native-phonepe-pg": "^3.1.1",
"react-native-reanimated": "4.7.1",
"react-native-safe-area-context": "~5.11.1",
"react-native-screens": "~4.30.1",
"react-native-razorpay": "^2.3.0",
"react-native-reanimated": "~3.17.4",
"react-native-safe-area-context": "5.4.0",
"react-native-screens": "~4.11.1",
"react-native-tab-view": "^4.1.3",
"react-native-toast-message": "^2.3.3",
"react-native-web": "~0.21.4",
"react-native-webview": "14.0.1",
"react-native-worklets": "0.13.0",
"react-native-web": "~0.20.0",
"react-native-webview": "13.13.5",
"twrnc": "^4.9.1",
"yup": "^1.7.0",
"zustand": "^5.0.10"

View file

@ -5,7 +5,7 @@ import type { ImageUploaderProps } from '@packages/shared';
import MyText from "./text";
import tw from '../lib/tailwind';
import Ionicons from "@expo/vector-icons/Ionicons";
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
import { MaterialIcons } from "@expo/vector-icons";
const ImageUploader: React.FC<ImageUploaderProps> = ({
images,

View file

@ -2,7 +2,8 @@ import React from 'react'
import { View } from 'react-native'
import { Image } from 'expo-image'
import Ionicons from '@expo/vector-icons/Ionicons'
import MaterialIcons from '@expo/vector-icons/MaterialIcons';import type { ImageUploaderNeoItem, ImageUploaderNeoPayload, ImageUploaderNeoProps } from '@packages/shared'
import { MaterialIcons } from '@expo/vector-icons'
import type { ImageUploaderNeoItem, ImageUploaderNeoPayload, ImageUploaderNeoProps } from '@packages/shared'
import tw from '../lib/tailwind'
import MyText from './text'
import MyTouchableOpacity from './touchable-opacity'

View file

@ -1,25 +1,13 @@
import React, { useState, useCallback, useRef, useEffect } from 'react';
import { View, TouchableOpacity, ScrollView, TextInput, Dimensions } from 'react-native';
import Ionicons from '@expo/vector-icons/Ionicons';
import { Text, View, TouchableOpacity, ScrollView, TextInput, Dimensions } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { BottomDialog } from './dialog';
import MyText from './text';
import { useTheme } from '../../hooks/theme-context';
import tw from '../lib/tailwind';
import { colors } from '../lib/theme-colors';
import type { DropdownOption as BaseDropdownOption } from '@packages/shared';
// 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;
}
import type { DropdownBaseProps } from './dropdown';
// Bottom/multi dropdown option — shared base + per-option disabled flag
export interface DropdownOption extends BaseDropdownOption {
@ -91,7 +79,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
const [searchQuery, setSearchQuery] = useState('');
// Which option's `detail` is expanded (one at a time).
const [expandedValue, setExpandedValue] = useState<string | number | null>(null);
const debounceTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const debounceTimeoutRef = useRef<number | null>(null);
// Debounced search function
const debouncedOnSearch = useCallback((query: string) => {
@ -193,7 +181,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
onPress={() => !disabled && setIsOpen(true)}
disabled={disabled}
>
<MyText
<Text
style={[
tw`flex-1`,
(multiple ? (value as string[]).length > 0 : options.some(opt => opt.value === value))
@ -204,7 +192,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
numberOfLines={1}
>
{getDisplayText()}
</MyText>
</Text>
<Ionicons
name="chevron-down"
size={16}
@ -224,7 +212,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
}
}}>
<View style={tw`py-4`}>
<MyText style={tw`text-lg font-semibold mb-4 text-center`}>{label}</MyText>
<Text style={tw`text-lg font-semibold mb-4 text-center`}>{label}</Text>
{/* Search Input - Fixed at top */}
{onSearch && (
@ -250,9 +238,9 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
>
{filteredOptions.length === 0 && searchQuery ? (
<View style={tw`py-8 px-4 items-center`}>
<MyText style={tw`text-gray-500 text-center`}>
<Text style={tw`text-gray-500 text-center`}>
No options found for "{searchQuery}"
</MyText>
</Text>
</View>
) : (
filteredOptions.map((option) => {
@ -274,27 +262,27 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
disabled={isDisabled}
>
<View style={tw`flex-1 mr-2`}>
<MyText
<Text
style={[
selected ? tw`text-brand700 font-semibold` : tw`text-gray-800`,
isDisabled && tw`text-gray-400`,
]}
>
<MyText style={tw`font-bold`}>{code}</MyText>
<Text style={tw`font-bold`}>{code}</Text>
{rest ? ` - ${rest}` : ''}
{option.disabled && option.note ? (
<MyText style={tw`italic`}> Disabled</MyText>
<Text style={tw`italic`}> Disabled</Text>
) : null}
</MyText>
</Text>
{!!option.note && (
<MyText
<Text
style={[
tw`text-xs mt-0.5`,
isDisabled ? tw`text-gray-400` : tw`text-gray-500`,
]}
>
{option.note}
</MyText>
</Text>
)}
</View>
{selected && (
@ -319,9 +307,9 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
color={colors.brand500}
style={tw`mr-1`}
/>
<MyText style={tw`text-xs font-medium text-brand500`}>
<Text style={tw`text-xs font-medium text-brand500`}>
{option.detail.label}
</MyText>
</Text>
</TouchableOpacity>
{isDetailOpen && (
@ -352,7 +340,7 @@ const BottomDropdown: React.FC<BottomDropdownProps> = ({
style={[tw`px-4 py-2 rounded-md flex-1 mr-2`, { backgroundColor: colors.brand500 }]}
onPress={handleDone}
>
<MyText style={tw`text-white text-center font-medium`}>Done</MyText>
<Text style={tw`text-white text-center font-medium`}>Done</Text>
</TouchableOpacity>
</View>
)}

View file

@ -1,5 +1,5 @@
import { useTheme } from "common-ui";
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import React from 'react';
import { Platform, TouchableOpacity, ViewStyle } from 'react-native';
// import { useTheme } from '../hooks/theme-context';
@ -31,11 +31,9 @@ const Checkbox: React.FC<CheckboxProps> = ({
const { colors } = useTheme().theme;
const fill = fillColor || colors.brand500;
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'
? checked ? 'check-box' : 'check-box-outline-blank'
: checked ? 'check-circle' : 'radio-button-unchecked';
? checked ? 'checkbox-marked' : 'checkbox-blank-outline'
: checked ? 'checkbox-marked-circle' : 'checkbox-blank-circle-outline';
return (
<TouchableOpacity
@ -47,7 +45,7 @@ const Checkbox: React.FC<CheckboxProps> = ({
accessibilityRole="checkbox"
accessibilityState={{ checked, disabled }}
>
<MaterialIcons
<MaterialCommunityIcons
name={iconName}
size={size}
color={disabled ? colors.gray1 : fill}

View file

@ -0,0 +1,100 @@
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;

View file

@ -1,11 +1,17 @@
import MaterialCommunityIcons from "@expo/vector-icons/MaterialCommunityIcons";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import DateTimePicker, {
AndroidNativeProps,
DateTimePickerAndroid,
DateTimePickerEvent,
} from "@react-native-community/datetimepicker";
import React, { useState } from "react";
import { Modal, Platform, TouchableOpacity, View } from "react-native";
import {
Modal,
Platform,
Text,
TouchableOpacity,
View,
} from "react-native";
import { useTheme, tw } from "common-ui";
import MyText from './text';
@ -62,12 +68,12 @@ function DateTimePickerMod(props: Props) {
<TouchableOpacity testID={testID} accessibilityLabel={testID} onPress={showTimepicker} style={tw`w-full`}>
{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`}>
<MyText style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>
<Text style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>
{value?.toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
}) || "Select Time"}
</MyText>
</Text>
<MaterialCommunityIcons
name="clock"
size={24}
@ -85,7 +91,7 @@ function DateTimePickerMod(props: Props) {
>
{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`}>
<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>
<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>
<MaterialCommunityIcons
name="calendar"
size={24}
@ -102,12 +108,12 @@ function DateTimePickerMod(props: Props) {
>
{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`}>
<MyText style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>
<Text style={[tw`text-sm font-medium text-gray-800 ml-0.5 mr-0.5`, { opacity: value ? 1 : 0.5 }]}>
{value?.toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
}) || "Select Time"}
</MyText>
</Text>
<MaterialCommunityIcons
name="clock"
size={24}
@ -139,7 +145,7 @@ function DateTimePickerMod(props: Props) {
onPress={() => setShow(false)}
style={tw`mt-2.5 bg-blue-500 rounded py-2.5 items-center`}
>
<MyText style={tw`text-white font-bold`}>Done</MyText>
<Text style={tw`text-white font-bold`}>Done</Text>
</TouchableOpacity>
</View>
</View>

View file

@ -0,0 +1,85 @@
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;

View file

@ -9,7 +9,7 @@ import {
ActivityIndicator,
Platform,
} from "react-native";
import Ionicons from "@expo/vector-icons/Ionicons";
import { Ionicons } from "@expo/vector-icons";
interface ImageViewerProps {
uri: string;

View file

@ -1,8 +1,7 @@
import React from 'react';
import { View, TouchableOpacity } from 'react-native';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import { View, TouchableOpacity, Text } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
import tw from '../lib/tailwind';
import MyText from './text';
import CartIcon from './icons/CartIcon';
interface MiniQuantifierProps {
@ -24,9 +23,9 @@ const MiniQuantifier: React.FC<MiniQuantifierProps> = ({ value, onChange, showUn
<MaterialIcons name="remove" size={12} color="#4B5563" />
</TouchableOpacity>
<View style={tw`px-1 flex-row items-center`}>
<MyText testID="mini-quantifier-value" style={tw`text-center text-gray-900 font-bold text-xs`}>{value}</MyText>
<Text testID="mini-quantifier-value" style={tw`text-center text-gray-900 font-bold text-xs`}>{value}</Text>
{showUnits && unit && (
<MyText style={tw`text-xs text-gray-400 font-medium ml-0.5`}>{unit}</MyText>
<Text style={tw`text-xs text-gray-400 font-medium ml-0.5`}>{unit}</Text>
)}
</View>
<TouchableOpacity

View file

@ -0,0 +1,118 @@
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;

View file

@ -1,7 +1,7 @@
import React from 'react';
import { TouchableOpacity, View } from 'react-native';
import { Image } from 'expo-image';
import Ionicons from '@expo/vector-icons/Ionicons';
import { Ionicons } from '@expo/vector-icons';
import usePickImage from './use-pick-image';
import tw from '../lib/tailwind';
import { theme } from '../theme';

View file

@ -1,9 +1,8 @@
import React from 'react';
import { View, TouchableOpacity } from 'react-native';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import { View, TouchableOpacity, Text } from 'react-native';
import { MaterialIcons } from '@expo/vector-icons';
import type { QuantifierProps } from '@packages/shared';
import tw from '../lib/tailwind';
import MyText from './text';
import { colors } from '../lib/theme-colors';
const Quantifier: React.FC<QuantifierProps> = ({
@ -31,14 +30,14 @@ const Quantifier: React.FC<QuantifierProps> = ({
</TouchableOpacity>
<View style={tw`flex-1 flex-row items-center justify-center px-1`}>
<MyText testID={`${testID}-value`} style={tw`text-center text-gray-900 font-bold text-base`}>
<Text testID={`${testID}-value`} style={tw`text-center text-gray-900 font-bold text-base`}>
{value}
</MyText>
</Text>
{/* {unitText && (
//hide unit text for now
<MyText style={tw`text-xs text-gray-400 font-medium ml-0.5 mt-0.5`}>
<Text style={tw`text-xs text-gray-400 font-medium ml-0.5 mt-0.5`}>
{unitText}
</MyText>
</Text>
)} */}
</View>

View file

@ -1,8 +1,6 @@
import React from 'react';
import { Text as PaperText } from 'react-native-paper';
import { TextProps as RNTextProps } from 'react-native';
import { StyleSheet } from 'react-native';
import { interFamilyFor } from '../lib/fonts';
import { useTheme } from "common-ui";
import type { Theme } from "common-ui";
// import { useTheme } from '../hooks/theme-context';
@ -13,15 +11,6 @@ type ThemeColor = keyof Theme['colors'];
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 {
children: React.ReactNode;
color?: ThemeColor;
@ -31,26 +20,40 @@ interface Props extends RNTextProps {
function MyText({ style, children, color, weight = 'regular', ...rest }: Props) {
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;
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 (
<PaperText
{...rest}
style={[
{ color: textColor, fontFamily },
styleWithoutWeight,
{ fontFamily, color: textColor, fontWeight },
style,
]}
allowFontScaling={false}
>

View file

@ -1,49 +0,0 @@
/**
* 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'
}

View file

@ -1,22 +0,0 @@
/**
* 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,
}