From c4c3c22151cb69fe34afbd8b5819c2649af08896 Mon Sep 17 00:00:00 2001 From: Tamojit Biswas Date: Thu, 9 Jul 2026 10:22:16 +0530 Subject: [PATCH] feat: add provider details, cart, and account screens along with supporting services and components --- app/components/productCard/productCard.tsx | 2 +- app/features/screens/accountScreen/accountScreen.tsx | 2 +- app/features/screens/cartScreen/cartScreen.tsx | 2 +- .../providerDetailsScreen/providerDetailsScreen.tsx | 7 +------ app/services/apiClient.ts | 2 +- app/utils/helper.ts | 2 +- app/utils/index.ts | 1 + 7 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 app/utils/index.ts diff --git a/app/components/productCard/productCard.tsx b/app/components/productCard/productCard.tsx index aca900d..f57916c 100644 --- a/app/components/productCard/productCard.tsx +++ b/app/components/productCard/productCard.tsx @@ -9,7 +9,7 @@ import { } from 'react-native'; import { getStyles } from './productCard.styles'; import { useAppTheme } from '@theme'; -import { getFullUrl } from '@utils/helper'; +import { getFullUrl } from '@utils'; export interface ProductCardProps { id: string; diff --git a/app/features/screens/accountScreen/accountScreen.tsx b/app/features/screens/accountScreen/accountScreen.tsx index b2d34ef..3bc53a6 100644 --- a/app/features/screens/accountScreen/accountScreen.tsx +++ b/app/features/screens/accountScreen/accountScreen.tsx @@ -121,7 +121,7 @@ export const AccountScreen: React.FC = () => { 📞 - {user?.mobileNumber || '+91 98765 43210'} + {user?.phone || '+91 98765 43210'} diff --git a/app/features/screens/cartScreen/cartScreen.tsx b/app/features/screens/cartScreen/cartScreen.tsx index 45729b9..3d441b2 100644 --- a/app/features/screens/cartScreen/cartScreen.tsx +++ b/app/features/screens/cartScreen/cartScreen.tsx @@ -12,7 +12,7 @@ import { } from '../../../store/commonreducers/cart'; import { AppStackParamList } from '../../../navigation/appStack'; import { useAppDispatch, useAppSelector } from '@store'; -import { getFullUrl } from '../../../utils/helper'; +import { getFullUrl } from '@utils'; // import { getFullUrl } from '@utils/helperr'; type CartScreenNavProp = StackNavigationProp; diff --git a/app/features/screens/providerDetailsScreen/providerDetailsScreen.tsx b/app/features/screens/providerDetailsScreen/providerDetailsScreen.tsx index 387abdd..e54727e 100644 --- a/app/features/screens/providerDetailsScreen/providerDetailsScreen.tsx +++ b/app/features/screens/providerDetailsScreen/providerDetailsScreen.tsx @@ -21,6 +21,7 @@ import { AppStackParamList } from '../../../navigation/appStack'; import { useAppDispatch, useAppSelector } from '@store'; import { getProductDetailsThunk } from './thunk'; import { getDiscountPercentage, formatPrice } from '@components'; +import { getFullUrl } from '@utils'; type ProviderDetailsNavProp = StackNavigationProp< AppStackParamList, @@ -33,12 +34,6 @@ type ProviderDetailsRouteProp = RouteProp< const { width } = Dimensions.get('window'); -const BASE_URL = 'https://2e1b-202-8-116-13.ngrok-free.app'; -const getFullUrl = (url?: string) => { - if (!url) return ''; - return url.startsWith('/') ? `${BASE_URL}${url}` : url; -}; - // TODO: move these into your shared Product type once the backend // response includes them. interface ProductReview { diff --git a/app/services/apiClient.ts b/app/services/apiClient.ts index 803a6d9..00fea15 100644 --- a/app/services/apiClient.ts +++ b/app/services/apiClient.ts @@ -15,7 +15,7 @@ const STORAGE_KEYS = { } as const; // ─── Config ────────────────────────────────────────────────────────────────── -const BASE_URL = 'https://9b5b-202-8-116-13.ngrok-free.app'; // TODO: replace with your actual base URL +const BASE_URL = 'https://db1d-202-8-116-13.ngrok-free.app'; // TODO: replace with your actual base URL // ─── Token Helpers ─────────────────────────────────────────────────────────── export const tokenManager = { diff --git a/app/utils/helper.ts b/app/utils/helper.ts index 69a8018..3c393c7 100644 --- a/app/utils/helper.ts +++ b/app/utils/helper.ts @@ -1,5 +1,5 @@ export const getFullUrl = (url?: string) => { - const BASE_URL = 'https://9b5b-202-8-116-13.ngrok-free.app'; + const BASE_URL = 'https://db1d-202-8-116-13.ngrok-free.app'; if (!url) return ''; return url.startsWith('/') ? `${BASE_URL}${url}` : url; }; diff --git a/app/utils/index.ts b/app/utils/index.ts new file mode 100644 index 0000000..d6d6f05 --- /dev/null +++ b/app/utils/index.ts @@ -0,0 +1 @@ +export * from './helper';