feat: add provider details, cart, and account screens along with supporting services and components
This commit is contained in:
parent
d7c2254d2e
commit
c4c3c22151
@ -9,7 +9,7 @@ import {
|
|||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { getStyles } from './productCard.styles';
|
import { getStyles } from './productCard.styles';
|
||||||
import { useAppTheme } from '@theme';
|
import { useAppTheme } from '@theme';
|
||||||
import { getFullUrl } from '@utils/helper';
|
import { getFullUrl } from '@utils';
|
||||||
|
|
||||||
export interface ProductCardProps {
|
export interface ProductCardProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@ -121,7 +121,7 @@ export const AccountScreen: React.FC = () => {
|
|||||||
<View style={styles.profilePhoneRow}>
|
<View style={styles.profilePhoneRow}>
|
||||||
<Text style={styles.profilePhoneIcon}>📞</Text>
|
<Text style={styles.profilePhoneIcon}>📞</Text>
|
||||||
<Text style={styles.profilePhone}>
|
<Text style={styles.profilePhone}>
|
||||||
{user?.mobileNumber || '+91 98765 43210'}
|
{user?.phone || '+91 98765 43210'}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import {
|
|||||||
} from '../../../store/commonreducers/cart';
|
} from '../../../store/commonreducers/cart';
|
||||||
import { AppStackParamList } from '../../../navigation/appStack';
|
import { AppStackParamList } from '../../../navigation/appStack';
|
||||||
import { useAppDispatch, useAppSelector } from '@store';
|
import { useAppDispatch, useAppSelector } from '@store';
|
||||||
import { getFullUrl } from '../../../utils/helper';
|
import { getFullUrl } from '@utils';
|
||||||
// import { getFullUrl } from '@utils/helperr';
|
// import { getFullUrl } from '@utils/helperr';
|
||||||
|
|
||||||
type CartScreenNavProp = StackNavigationProp<AppStackParamList, 'CartScreen'>;
|
type CartScreenNavProp = StackNavigationProp<AppStackParamList, 'CartScreen'>;
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import { AppStackParamList } from '../../../navigation/appStack';
|
|||||||
import { useAppDispatch, useAppSelector } from '@store';
|
import { useAppDispatch, useAppSelector } from '@store';
|
||||||
import { getProductDetailsThunk } from './thunk';
|
import { getProductDetailsThunk } from './thunk';
|
||||||
import { getDiscountPercentage, formatPrice } from '@components';
|
import { getDiscountPercentage, formatPrice } from '@components';
|
||||||
|
import { getFullUrl } from '@utils';
|
||||||
|
|
||||||
type ProviderDetailsNavProp = StackNavigationProp<
|
type ProviderDetailsNavProp = StackNavigationProp<
|
||||||
AppStackParamList,
|
AppStackParamList,
|
||||||
@ -33,12 +34,6 @@ type ProviderDetailsRouteProp = RouteProp<
|
|||||||
|
|
||||||
const { width } = Dimensions.get('window');
|
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
|
// TODO: move these into your shared Product type once the backend
|
||||||
// response includes them.
|
// response includes them.
|
||||||
interface ProductReview {
|
interface ProductReview {
|
||||||
|
|||||||
@ -15,7 +15,7 @@ const STORAGE_KEYS = {
|
|||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
// ─── Config ──────────────────────────────────────────────────────────────────
|
// ─── 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 ───────────────────────────────────────────────────────────
|
// ─── Token Helpers ───────────────────────────────────────────────────────────
|
||||||
export const tokenManager = {
|
export const tokenManager = {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
export const getFullUrl = (url?: string) => {
|
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 '';
|
if (!url) return '';
|
||||||
return url.startsWith('/') ? `${BASE_URL}${url}` : url;
|
return url.startsWith('/') ? `${BASE_URL}${url}` : url;
|
||||||
};
|
};
|
||||||
|
|||||||
1
app/utils/index.ts
Normal file
1
app/utils/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from './helper';
|
||||||
Loading…
x
Reference in New Issue
Block a user