File size: 5,363 Bytes
5c876be | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | import type { VehicleType } from '../types/user';
import type { RideStatus } from '../types/ride';
import { colors } from '../theme';
// βββ App Identity ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
export const APP_NAME = 'Antaram';
export const APP_TAGLINE = 'Share rides, save the planet';
// βββ Default Location (Bangalore, India) βββββββββββββββββββββββββββββββββββββ
export const DEFAULT_LOCATION = {
lat: 12.9716,
lng: 77.5946,
address: 'Bangalore, Karnataka, India',
} as const;
// βββ Map Defaults ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
export const MAP_TILE_URL = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png';
export const MAP_TILE_ATTRIBUTION =
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
export const MAP_DEFAULT_ZOOM = 14;
export const MAP_MIN_ZOOM = 4;
export const MAP_MAX_ZOOM = 19;
export const MAP_INITIAL_DELTA = 0.01; // ~1km lat/lng span
// βββ Vehicle Types βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
export interface VehicleTypeInfo {
type: VehicleType;
label: string;
icon: string;
emoji: string;
seats: number;
baseFare: number;
perKmRate: number;
}
export const VEHICLE_TYPES: VehicleTypeInfo[] = [
{
type: 'bike',
label: 'Bike',
icon: 'motorbike',
emoji: 'ποΈ',
seats: 1,
baseFare: 10,
perKmRate: 8,
},
{
type: 'auto',
label: 'Auto',
icon: 'car-side',
emoji: 'πΊ',
seats: 3,
baseFare: 20,
perKmRate: 12,
},
{
type: 'car',
label: 'Car',
icon: 'car',
emoji: 'π',
seats: 4,
baseFare: 30,
perKmRate: 15,
},
];
// βββ Ride Status Colors ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
export const RIDE_STATUS_COLORS: Record<RideStatus, string> = {
draft: colors.neutral[400],
active: colors.primary[500],
matched: colors.secondary[500],
ongoing: colors.tertiary[500],
completed: colors.success,
cancelled: colors.error,
};
export const RIDE_STATUS_LABELS: Record<RideStatus, string> = {
draft: 'Draft',
active: 'Active',
matched: 'Matched',
ongoing: 'On Ride',
completed: 'Completed',
cancelled: 'Cancelled',
};
// βββ Search & History Limits βββββββββββββββββββββββββββββββββββββββββββββββββ
export const MAX_SEARCH_HISTORY = 20;
export const MAX_SAVED_LOCATIONS = 30;
export const MAX_FRIEND_REQUESTS = 50;
// βββ SOS βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
export const SOS_HOLD_DURATION = 3000; // ms to hold SOS button
export const SOS_CONTACTS_LIMIT = 5;
// βββ Notification Types ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
export type NotificationType =
| 'ride_matched'
| 'ride_cancelled'
| 'message'
| 'friend_request'
| 'friend_accepted'
| 'ride_reminder'
| 'system'
| 'sos_alert';
export interface NotificationTypeInfo {
type: NotificationType;
label: string;
icon: string;
channel: string;
}
export const NOTIFICATION_TYPES: NotificationTypeInfo[] = [
{
type: 'ride_matched',
label: 'Ride Matched',
icon: 'handshake',
channel: 'rides',
},
{
type: 'ride_cancelled',
label: 'Ride Cancelled',
icon: 'close-circle',
channel: 'rides',
},
{
type: 'message',
label: 'New Message',
icon: 'chat',
channel: 'messages',
},
{
type: 'friend_request',
label: 'Friend Request',
icon: 'account-plus',
channel: 'social',
},
{
type: 'friend_accepted',
label: 'Friend Accepted',
icon: 'account-check',
channel: 'social',
},
{
type: 'ride_reminder',
label: 'Ride Reminder',
icon: 'bell-ring',
channel: 'rides',
},
{
type: 'system',
label: 'System',
icon: 'information',
channel: 'system',
},
{
type: 'sos_alert',
label: 'SOS Alert',
icon: 'alert',
channel: 'sos',
},
];
// βββ Misc ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
export const LOCATION_UPDATE_INTERVAL = 5000; // 5 seconds
export const LOCATION_UPDATE_DISTANCE = 10; // 10 meters
export const RATING_MIN = 1;
export const RATING_MAX = 5;
export const RATING_DEFAULT = 0;
export const MAX_SEATS_AVAILABLE = 4;
export const FARE_ESTIMATE_BUFFER = 0.15; // Β±15% variance for estimates
|