@imksh/create 1.0.25 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/package.json +1 -1
  2. package/src/commands/create.js +2 -1
  3. package/src/index.js +1 -1
  4. package/src/utils/askTemplate.js +1 -0
  5. package/templates/mern-react-native/mobile/_gitignore +43 -0
  6. package/templates/mern-react-native/mobile/package.json +2 -1
  7. package/templates/mern-react-native/mobile/src/app/(auth)/edit-profile.tsx +11 -15
  8. package/templates/mern-react-native/mobile/src/app/(tabs)/dashboard.tsx +2 -2
  9. package/templates/mern-react-native/mobile/src/app/(tabs)/search.tsx +2 -2
  10. package/templates/mern-react-native/mobile/src/config/sidebar.config.ts +0 -60
  11. package/templates/mern-react-native/mobile/src/config/tabNavigation.ts +6 -36
  12. package/templates/mern-react-native/mobile/src/services/notification.service.ts +22 -0
  13. package/templates/mern-react-native/mobile/src/store/useNotificationStore.ts +158 -33
  14. package/templates/next/next.config.mjs +1 -0
  15. package/templates/next/package.json +10 -9
  16. package/templates/next/postcss.config.js +5 -0
  17. package/templates/next/src/app/layout.js +1 -0
  18. package/templates/next/src/app/page.js +1 -1
  19. package/templates/next/src/components/layout/ProtectedRoute.jsx +3 -3
  20. package/templates/next/src/index.css +1 -0
  21. package/templates/next/src/store/useUiStore.js +13 -7
  22. package/templates/next-ts/.env.example +0 -0
  23. package/templates/next-ts/AGENTS.md +37 -0
  24. package/templates/next-ts/CLAUDE.md +1 -0
  25. package/templates/next-ts/_gitignore +0 -24
  26. package/templates/next-ts/next-env.d.ts +3 -1
  27. package/templates/next-ts/next.config.mjs +1 -0
  28. package/templates/next-ts/package.json +13 -12
  29. package/templates/next-ts/postcss.config.js +5 -0
  30. package/templates/next-ts/public/logo.png +0 -0
  31. package/templates/next-ts/src/app/error.tsx +41 -0
  32. package/templates/next-ts/src/app/layout.tsx +2 -1
  33. package/templates/next-ts/src/app/not-found.tsx +5 -0
  34. package/templates/next-ts/src/app/page.tsx +1 -1
  35. package/templates/next-ts/src/components/layout/ProtectedRoute.tsx +3 -3
  36. package/templates/next-ts/src/components/ui/Button.tsx +63 -0
  37. package/templates/next-ts/src/components/ui/Input.tsx +79 -0
  38. package/templates/next-ts/src/index.css +1 -0
  39. package/templates/next-ts/src/store/useUiStore.ts +13 -7
  40. package/templates/next-ts/tsconfig.json +19 -5
  41. package/templates/production-fullstack/client/index.html +14 -0
  42. package/templates/production-fullstack/client/package.json +47 -0
  43. package/templates/production-fullstack/client/public/_redirects +1 -0
  44. package/templates/production-fullstack/client/public/favicon.ico +0 -0
  45. package/templates/production-fullstack/client/public/favicon.svg +1 -0
  46. package/templates/production-fullstack/client/public/logo.png +0 -0
  47. package/templates/production-fullstack/client/public/manifest.json +24 -0
  48. package/templates/production-fullstack/client/public/sw.js +56 -0
  49. package/templates/production-fullstack/client/src/App.tsx +68 -0
  50. package/templates/production-fullstack/client/src/assets/animations/loading.json +1 -0
  51. package/templates/production-fullstack/client/src/assets/data/navigation.ts +29 -0
  52. package/templates/production-fullstack/client/src/assets/images/logo.png +0 -0
  53. package/templates/production-fullstack/client/src/components/layout/ProtectedRoute.tsx +23 -0
  54. package/templates/production-fullstack/client/src/components/layout/PublicLayout.tsx +13 -0
  55. package/templates/production-fullstack/client/src/components/layout/SidebarLayout.tsx +37 -0
  56. package/templates/production-fullstack/client/src/components/shared/Breadcrumbs.tsx +27 -0
  57. package/templates/production-fullstack/client/src/components/shared/LottieIcon.tsx +36 -0
  58. package/templates/production-fullstack/client/src/components/shared/NotFound.tsx +78 -0
  59. package/templates/production-fullstack/client/src/components/shared/PwaInstallPrompt.tsx +72 -0
  60. package/templates/production-fullstack/client/src/components/shared/SEO.tsx +67 -0
  61. package/templates/production-fullstack/client/src/components/shared/Scroll.tsx +25 -0
  62. package/templates/production-fullstack/client/src/components/shared/Unauthorized.tsx +76 -0
  63. package/templates/production-fullstack/client/src/components/shared/skeletons/common/CardSkeleton.tsx +23 -0
  64. package/templates/production-fullstack/client/src/components/shared/skeletons/common/DashboardSkeleton.tsx +19 -0
  65. package/templates/production-fullstack/client/src/components/shared/skeletons/common/ListSkeleton.tsx +24 -0
  66. package/templates/production-fullstack/client/src/components/shared/skeletons/common/PageSkeleton.tsx +26 -0
  67. package/templates/production-fullstack/client/src/components/shared/skeletons/common/ProfileSkeleton.tsx +23 -0
  68. package/templates/production-fullstack/client/src/components/shared/skeletons/common/Skeleton.tsx +18 -0
  69. package/templates/production-fullstack/client/src/components/shared/skeletons/common/TableSkeleton.tsx +33 -0
  70. package/templates/production-fullstack/client/src/components/ui/ConfirmModal.tsx +152 -0
  71. package/templates/production-fullstack/client/src/components/ui/Header.tsx +230 -0
  72. package/templates/production-fullstack/client/src/components/ui/Loading.tsx +19 -0
  73. package/templates/production-fullstack/client/src/components/ui/Modal.tsx +106 -0
  74. package/templates/production-fullstack/client/src/components/ui/SidebarHeader.tsx +34 -0
  75. package/templates/production-fullstack/client/src/components/ui/Table.tsx +118 -0
  76. package/templates/production-fullstack/client/src/components/ui/ToggleSwitch.tsx +38 -0
  77. package/templates/production-fullstack/client/src/components/ui/sidebar.tsx +152 -0
  78. package/templates/production-fullstack/client/src/config/index.ts +44 -0
  79. package/templates/production-fullstack/client/src/constants/navigation.ts +14 -0
  80. package/templates/production-fullstack/client/src/features/auth/api/authService.ts +19 -0
  81. package/templates/production-fullstack/client/src/features/auth/pages/Login.tsx +233 -0
  82. package/templates/production-fullstack/client/src/features/auth/store/useAuthStore.ts +143 -0
  83. package/templates/production-fullstack/client/src/features/core/pages/Home.tsx +150 -0
  84. package/templates/production-fullstack/client/src/features/core/pages/Profile.tsx +9 -0
  85. package/templates/production-fullstack/client/src/hooks/useLenis.ts +28 -0
  86. package/templates/production-fullstack/client/src/hooks/usePwaInstall.ts +45 -0
  87. package/templates/production-fullstack/client/src/hooks/useWindowSize.ts +25 -0
  88. package/templates/production-fullstack/client/src/index.css +158 -0
  89. package/templates/production-fullstack/client/src/lib/axios.ts +22 -0
  90. package/templates/production-fullstack/client/src/lib/dayjs.ts +12 -0
  91. package/templates/production-fullstack/client/src/lib/query-client.ts +11 -0
  92. package/templates/production-fullstack/client/src/lib/socket.ts +6 -0
  93. package/templates/production-fullstack/client/src/main.tsx +28 -0
  94. package/templates/production-fullstack/client/src/store/useUiStore.ts +74 -0
  95. package/templates/production-fullstack/client/src/utils/formatDate.ts +19 -0
  96. package/templates/production-fullstack/client/src/utils/getInitials.ts +10 -0
  97. package/templates/production-fullstack/client/src/vite-env.d.ts +1 -0
  98. package/templates/production-fullstack/client/tsconfig.json +25 -0
  99. package/templates/production-fullstack/client/tsconfig.node.json +10 -0
  100. package/templates/production-fullstack/client/vite.config.ts +8 -0
  101. package/templates/production-fullstack/mobile/LICENSE +21 -0
  102. package/templates/production-fullstack/mobile/app.json +84 -0
  103. package/templates/production-fullstack/mobile/assets/animations/celebrate.json +1 -0
  104. package/templates/production-fullstack/mobile/assets/animations/infinity.json +1 -0
  105. package/templates/production-fullstack/mobile/assets/animations/loading.json +1 -0
  106. package/templates/production-fullstack/mobile/assets/fonts/Inter_Bold.ttf +0 -0
  107. package/templates/production-fullstack/mobile/assets/fonts/Inter_ExtraBold.ttf +0 -0
  108. package/templates/production-fullstack/mobile/assets/fonts/Inter_Medium.ttf +0 -0
  109. package/templates/production-fullstack/mobile/assets/fonts/Inter_Regular.ttf +0 -0
  110. package/templates/production-fullstack/mobile/assets/fonts/Inter_SemiBold.ttf +0 -0
  111. package/templates/production-fullstack/mobile/assets/images/logo/logo.png +0 -0
  112. package/templates/production-fullstack/mobile/assets/images/logo/logo.svg +1 -0
  113. package/templates/production-fullstack/mobile/assets/images/logo/logoWithBg.png +0 -0
  114. package/templates/production-fullstack/mobile/babel.config.js +13 -0
  115. package/templates/production-fullstack/mobile/drizzle.config.ts +8 -0
  116. package/templates/production-fullstack/mobile/eas.json +24 -0
  117. package/templates/production-fullstack/mobile/eslint.config.js +10 -0
  118. package/templates/production-fullstack/mobile/metro.config.js +6 -0
  119. package/templates/production-fullstack/mobile/nativewind-env.d.ts +3 -0
  120. package/templates/production-fullstack/mobile/package.json +89 -0
  121. package/templates/production-fullstack/mobile/src/app/(auth)/_layout.tsx +12 -0
  122. package/templates/production-fullstack/mobile/src/app/(auth)/change-password.tsx +112 -0
  123. package/templates/production-fullstack/mobile/src/app/(auth)/edit-profile.tsx +160 -0
  124. package/templates/production-fullstack/mobile/src/app/(auth)/forgot-password.tsx +191 -0
  125. package/templates/production-fullstack/mobile/src/app/(auth)/login.tsx +253 -0
  126. package/templates/production-fullstack/mobile/src/app/_layout.tsx +102 -0
  127. package/templates/production-fullstack/mobile/src/app/global.css +82 -0
  128. package/templates/production-fullstack/mobile/src/components/common/AnimatedHeader.tsx +328 -0
  129. package/templates/production-fullstack/mobile/src/components/common/ConfirmationToast.tsx +67 -0
  130. package/templates/production-fullstack/mobile/src/components/common/Loading.tsx +26 -0
  131. package/templates/production-fullstack/mobile/src/components/common/LocationLoader.tsx +591 -0
  132. package/templates/production-fullstack/mobile/src/components/common/ScreenHeader.tsx +68 -0
  133. package/templates/production-fullstack/mobile/src/components/common/TabHeader.tsx +58 -0
  134. package/templates/production-fullstack/mobile/src/components/common/Typography.tsx +113 -0
  135. package/templates/production-fullstack/mobile/src/components/common/Welcome.tsx +55 -0
  136. package/templates/production-fullstack/mobile/src/components/ui/BottomModal.tsx +159 -0
  137. package/templates/production-fullstack/mobile/src/components/ui/ClassicTabBar.tsx +129 -0
  138. package/templates/production-fullstack/mobile/src/components/ui/CustomTabBar.tsx +238 -0
  139. package/templates/production-fullstack/mobile/src/components/ui/Sidebar.tsx +258 -0
  140. package/templates/production-fullstack/mobile/src/components/ui/buttons/Button.tsx +180 -0
  141. package/templates/production-fullstack/mobile/src/components/ui/buttons/ButtonGroup.tsx +32 -0
  142. package/templates/production-fullstack/mobile/src/components/ui/buttons/FloatingActionButton.tsx +72 -0
  143. package/templates/production-fullstack/mobile/src/components/ui/buttons/IconButton.tsx +84 -0
  144. package/templates/production-fullstack/mobile/src/components/ui/data-display/Accordion.tsx +82 -0
  145. package/templates/production-fullstack/mobile/src/components/ui/data-display/Avatar.tsx +47 -0
  146. package/templates/production-fullstack/mobile/src/components/ui/data-display/Badge.tsx +104 -0
  147. package/templates/production-fullstack/mobile/src/components/ui/data-display/Card.tsx +36 -0
  148. package/templates/production-fullstack/mobile/src/components/ui/data-display/Image.tsx +43 -0
  149. package/templates/production-fullstack/mobile/src/components/ui/data-display/ImageViewer.tsx +33 -0
  150. package/templates/production-fullstack/mobile/src/components/ui/data-display/SwipeableRow.tsx +94 -0
  151. package/templates/production-fullstack/mobile/src/components/ui/feedback/CircularProgress.tsx +38 -0
  152. package/templates/production-fullstack/mobile/src/components/ui/feedback/GestureWrapper.tsx +114 -0
  153. package/templates/production-fullstack/mobile/src/components/ui/feedback/ProgressBar.tsx +51 -0
  154. package/templates/production-fullstack/mobile/src/components/ui/feedback/Skeleton.tsx +84 -0
  155. package/templates/production-fullstack/mobile/src/components/ui/feedback/Spinner.tsx +50 -0
  156. package/templates/production-fullstack/mobile/src/components/ui/inputs/Checkbox.tsx +54 -0
  157. package/templates/production-fullstack/mobile/src/components/ui/inputs/DatePicker.tsx +186 -0
  158. package/templates/production-fullstack/mobile/src/components/ui/inputs/ImagePickerModal.tsx +129 -0
  159. package/templates/production-fullstack/mobile/src/components/ui/inputs/Input.tsx +158 -0
  160. package/templates/production-fullstack/mobile/src/components/ui/inputs/LocationPicker.tsx +211 -0
  161. package/templates/production-fullstack/mobile/src/components/ui/inputs/OTPInput.tsx +83 -0
  162. package/templates/production-fullstack/mobile/src/components/ui/inputs/PasswordInput.tsx +16 -0
  163. package/templates/production-fullstack/mobile/src/components/ui/inputs/Radio.tsx +54 -0
  164. package/templates/production-fullstack/mobile/src/components/ui/inputs/SearchBar.tsx +53 -0
  165. package/templates/production-fullstack/mobile/src/components/ui/inputs/Slider.tsx +49 -0
  166. package/templates/production-fullstack/mobile/src/components/ui/inputs/Switch.tsx +75 -0
  167. package/templates/production-fullstack/mobile/src/components/ui/inputs/TextArea.tsx +15 -0
  168. package/templates/production-fullstack/mobile/src/components/ui/inputs/WebLocationPicker.tsx +321 -0
  169. package/templates/production-fullstack/mobile/src/components/ui/layout/Container.tsx +23 -0
  170. package/templates/production-fullstack/mobile/src/components/ui/layout/Divider.tsx +20 -0
  171. package/templates/production-fullstack/mobile/src/components/ui/layout/Grid.tsx +62 -0
  172. package/templates/production-fullstack/mobile/src/components/ui/layout/KeyboardAvoidingViewWrapper.tsx +16 -0
  173. package/templates/production-fullstack/mobile/src/components/ui/layout/ScrollContainer.tsx +21 -0
  174. package/templates/production-fullstack/mobile/src/components/ui/layout/Section.tsx +51 -0
  175. package/templates/production-fullstack/mobile/src/components/ui/layout/Spacer.tsx +6 -0
  176. package/templates/production-fullstack/mobile/src/components/ui/layout/Stack.tsx +34 -0
  177. package/templates/production-fullstack/mobile/src/components/ui/navigation/Pagination.tsx +61 -0
  178. package/templates/production-fullstack/mobile/src/components/ui/navigation/ProgressStepper.tsx +66 -0
  179. package/templates/production-fullstack/mobile/src/components/ui/navigation/Tabs.tsx +173 -0
  180. package/templates/production-fullstack/mobile/src/config/sidebar.config.ts +72 -0
  181. package/templates/production-fullstack/mobile/src/config/tabNavigation.ts +64 -0
  182. package/templates/production-fullstack/mobile/src/constants/Colors.ts +71 -0
  183. package/templates/production-fullstack/mobile/src/db/index.ts +9 -0
  184. package/templates/production-fullstack/mobile/src/db/schema.ts +14 -0
  185. package/templates/production-fullstack/mobile/src/features/auth/api/auth.service.ts +35 -0
  186. package/templates/production-fullstack/mobile/src/features/auth/store/useAuthStore.ts +273 -0
  187. package/templates/production-fullstack/mobile/src/features/auth/types/auth.type.ts +14 -0
  188. package/templates/production-fullstack/mobile/src/hooks/useDebounce.ts +17 -0
  189. package/templates/production-fullstack/mobile/src/lib/axios.ts +27 -0
  190. package/templates/production-fullstack/mobile/src/lib/query-client.ts +11 -0
  191. package/templates/production-fullstack/mobile/src/lib/socket.ts +36 -0
  192. package/templates/production-fullstack/mobile/src/lib/storage.ts +55 -0
  193. package/templates/production-fullstack/mobile/src/services/permission.service.ts +214 -0
  194. package/templates/production-fullstack/mobile/src/store/localStore.ts +7 -0
  195. package/templates/production-fullstack/mobile/src/store/useNotificationStore.ts +53 -0
  196. package/templates/production-fullstack/mobile/src/types/common.type.ts +6 -0
  197. package/templates/production-fullstack/mobile/src/types/images.d.ts +24 -0
  198. package/templates/production-fullstack/mobile/src/utils/toast.ts +26 -0
  199. package/templates/production-fullstack/mobile/tailwind.config.js +71 -0
  200. package/templates/production-fullstack/mobile/tsconfig.json +23 -0
  201. package/templates/production-fullstack/server/.env.example +63 -0
  202. package/templates/production-fullstack/server/README.md +75 -0
  203. package/templates/production-fullstack/server/eslint.config.js +13 -0
  204. package/templates/production-fullstack/server/package.json +58 -0
  205. package/templates/production-fullstack/server/prisma/schema/core/attachment.prisma +14 -0
  206. package/templates/production-fullstack/server/prisma/schema/core/notification.prisma +18 -0
  207. package/templates/production-fullstack/server/prisma/schema/core/permission.prisma +26 -0
  208. package/templates/production-fullstack/server/prisma/schema/core/role.prisma +25 -0
  209. package/templates/production-fullstack/server/prisma/schema/core/user.prisma +56 -0
  210. package/templates/production-fullstack/server/prisma/schema/enums/common.prisma +13 -0
  211. package/templates/production-fullstack/server/prisma/schema/enums/notification.prisma +6 -0
  212. package/templates/production-fullstack/server/prisma/schema/enums/user.prisma +11 -0
  213. package/templates/production-fullstack/server/prisma/schema/schema.prisma +7 -0
  214. package/templates/production-fullstack/server/prisma.config.ts +14 -0
  215. package/templates/production-fullstack/server/src/app.ts +36 -0
  216. package/templates/production-fullstack/server/src/common/middlewares/auth.middleware.ts +45 -0
  217. package/templates/production-fullstack/server/src/common/middlewares/errorHandler.ts +16 -0
  218. package/templates/production-fullstack/server/src/common/middlewares/multer.ts +20 -0
  219. package/templates/production-fullstack/server/src/common/middlewares/rateLimiter.ts +53 -0
  220. package/templates/production-fullstack/server/src/common/services/email.service.ts +28 -0
  221. package/templates/production-fullstack/server/src/common/services/push.service.ts +65 -0
  222. package/templates/production-fullstack/server/src/common/services/storage.service.ts +9 -0
  223. package/templates/production-fullstack/server/src/common/types/express.d.ts +10 -0
  224. package/templates/production-fullstack/server/src/common/utils/cloudinaryUpload.ts +44 -0
  225. package/templates/production-fullstack/server/src/common/utils/emailOtp.ts +30 -0
  226. package/templates/production-fullstack/server/src/common/utils/genOtpToken.ts +22 -0
  227. package/templates/production-fullstack/server/src/common/utils/generateVapidKeys.ts +12 -0
  228. package/templates/production-fullstack/server/src/common/utils/jwt.ts +27 -0
  229. package/templates/production-fullstack/server/src/common/utils/pushHelper.ts +22 -0
  230. package/templates/production-fullstack/server/src/config/env.ts +2 -0
  231. package/templates/production-fullstack/server/src/config/logger.ts +58 -0
  232. package/templates/production-fullstack/server/src/config/prisma.ts +26 -0
  233. package/templates/production-fullstack/server/src/features/attachments/upload.controller.ts +22 -0
  234. package/templates/production-fullstack/server/src/features/attachments/upload.routes.ts +11 -0
  235. package/templates/production-fullstack/server/src/features/auth/auth.controller.ts +124 -0
  236. package/templates/production-fullstack/server/src/features/auth/auth.routes.ts +22 -0
  237. package/templates/production-fullstack/server/src/features/auth/auth.service.ts +155 -0
  238. package/templates/production-fullstack/server/src/features/notifications/push.controller.ts +55 -0
  239. package/templates/production-fullstack/server/src/features/notifications/push.routes.ts +11 -0
  240. package/templates/production-fullstack/server/src/index.ts +17 -0
  241. package/templates/production-fullstack/server/src/routes/index.ts +12 -0
  242. package/templates/production-fullstack/server/src/sockets/auth.ts +0 -0
  243. package/templates/production-fullstack/server/src/sockets/connection.ts +31 -0
  244. package/templates/production-fullstack/server/src/sockets/emitters/assignment.emitter.ts +0 -0
  245. package/templates/production-fullstack/server/src/sockets/emitters/attendance.emitter.ts +0 -0
  246. package/templates/production-fullstack/server/src/sockets/emitters/exam.emitter.ts +0 -0
  247. package/templates/production-fullstack/server/src/sockets/emitters/notification.emitter.ts +17 -0
  248. package/templates/production-fullstack/server/src/sockets/events.ts +27 -0
  249. package/templates/production-fullstack/server/src/sockets/handlers/attendance.handler.ts +0 -0
  250. package/templates/production-fullstack/server/src/sockets/handlers/chat.handler.ts +0 -0
  251. package/templates/production-fullstack/server/src/sockets/handlers/index.ts +15 -0
  252. package/templates/production-fullstack/server/src/sockets/handlers/lms.handler.ts +0 -0
  253. package/templates/production-fullstack/server/src/sockets/handlers/notification.handler.ts +39 -0
  254. package/templates/production-fullstack/server/src/sockets/index.ts +39 -0
  255. package/templates/production-fullstack/server/src/sockets/middleware.ts +54 -0
  256. package/templates/production-fullstack/server/src/sockets/rooms.ts +11 -0
  257. package/templates/production-fullstack/server/src/sockets/types.ts +32 -0
  258. package/templates/production-fullstack/server/tsconfig.json +14 -0
  259. package/templates/react-native/package.json +2 -1
  260. package/templates/react-native/src/app/(auth)/edit-profile.tsx +11 -15
  261. package/templates/react-native/src/app/(tabs)/dashboard.tsx +2 -2
  262. package/templates/react-native/src/app/(tabs)/search.tsx +2 -2
  263. package/templates/react-native/src/config/sidebar.config.ts +0 -60
  264. package/templates/react-native/src/config/tabNavigation.ts +6 -36
  265. package/templates/react-native/src/services/notification.service.ts +22 -0
  266. package/templates/react-native/src/store/useNotificationStore.ts +158 -33
  267. /package/templates/{react-native → production-fullstack/mobile}/expo-env.d.ts +0 -0
@@ -0,0 +1,591 @@
1
+ import React, { useEffect, ReactElement, useState } from "react";
2
+ import { View, Dimensions, StyleSheet } from "react-native";
3
+ import { Ionicons } from "@expo/vector-icons";
4
+ import { Txt } from "./Typography";
5
+ import { useColorScheme } from "nativewind";
6
+ import { Colors } from "../../constants/Colors";
7
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
8
+ import Animated, {
9
+ useSharedValue,
10
+ useAnimatedStyle,
11
+ withRepeat,
12
+ withSequence,
13
+ withTiming,
14
+ Easing,
15
+ withDelay,
16
+ withSpring,
17
+ interpolate,
18
+ Extrapolation,
19
+ } from "react-native-reanimated";
20
+ import { LinearGradient } from "expo-linear-gradient";
21
+
22
+ const { width, height } = Dimensions.get("window");
23
+
24
+ const MW = width * 3;
25
+ const MH = height * 2.8;
26
+
27
+ // ─────────────────────────────────────────
28
+ // THEME-AWARE MAP PALETTE
29
+ // Light: warm beige city, white roads
30
+ // Dark: deep navy city, slate roads
31
+ // ─────────────────────────────────────────
32
+ const LIGHT_MAP = {
33
+ base: "#EDE8DF",
34
+ block: ["#C9B99A", "#BFB08F", "#D4C4A8", "#CCC0A0", "#B8A880"],
35
+ road: "#FFFFFF",
36
+ roadMn: "#F0EBE0",
37
+ lane: "#E8C84A",
38
+ water: "#A8C8E8",
39
+ park: "#8BC34A",
40
+ };
41
+ const DARK_MAP = {
42
+ base: "#0F172A",
43
+ block: ["#1E293B", "#172032", "#243044", "#1A2638", "#202E40"],
44
+ road: "#2A3445",
45
+ roadMn: "#1B2433",
46
+ lane: "#60A5FA",
47
+ water: "#1e3a5f",
48
+ park: "#14532d",
49
+ };
50
+
51
+ // ─── Map Primitives ───
52
+ const Water = ({ top, left, w, h, rx = 8, dark }: any) => (
53
+ <View style={{
54
+ position: "absolute", top, left, width: w, height: h,
55
+ backgroundColor: dark ? DARK_MAP.water : LIGHT_MAP.water,
56
+ borderRadius: rx, opacity: 0.9,
57
+ }} />
58
+ );
59
+ const Park = ({ top, left, w, h, rx = 6, dark }: any) => (
60
+ <View style={{
61
+ position: "absolute", top, left, width: w, height: h,
62
+ backgroundColor: dark ? DARK_MAP.park : LIGHT_MAP.park,
63
+ borderRadius: rx, opacity: dark ? 0.6 : 0.55,
64
+ }} />
65
+ );
66
+ const Block = ({ top, left, w, h, shade = 0, dark }: any) => {
67
+ const palette = dark ? DARK_MAP.block : LIGHT_MAP.block;
68
+ return (
69
+ <View style={{
70
+ position: "absolute", top, left, width: w, height: h,
71
+ backgroundColor: palette[shade % palette.length],
72
+ borderRadius: 3, opacity: 0.9,
73
+ }} />
74
+ );
75
+ };
76
+ const Road = ({ top, left, w, h, major = false, dark }: any) => (
77
+ <View style={{
78
+ position: "absolute", top, left, width: w, height: h,
79
+ backgroundColor: major ? (dark ? DARK_MAP.road : LIGHT_MAP.road)
80
+ : (dark ? DARK_MAP.roadMn : LIGHT_MAP.roadMn),
81
+ opacity: major ? 0.95 : 0.75,
82
+ }} />
83
+ );
84
+ const LaneDash = ({ top, left, vertical = false, dark }: any) => (
85
+ <View style={{
86
+ position: "absolute", top, left,
87
+ width: vertical ? 2 : 12, height: vertical ? 12 : 2,
88
+ backgroundColor: dark ? DARK_MAP.lane : LIGHT_MAP.lane,
89
+ opacity: dark ? 0.3 : 0.45,
90
+ }} />
91
+ );
92
+
93
+ // ─── The full map world ───
94
+ const MapWorld = ({ dark }: { dark: boolean }) => {
95
+ const roads: ReactElement[] = [];
96
+ const blocks: ReactElement[] = [];
97
+ const dashes: ReactElement[] = [];
98
+
99
+ const hMajorY = [MH * 0.18, MH * 0.36, MH * 0.54, MH * 0.72, MH * 0.88];
100
+ hMajorY.forEach((y, i) => {
101
+ roads.push(<Road key={`hm${i}`} top={y} left={0} w={MW} h={14} major dark={dark} />);
102
+ for (let x = 0; x < MW; x += 32) {
103
+ dashes.push(<LaneDash key={`hd${i}-${x}`} top={y + 6} left={x} dark={dark} />);
104
+ }
105
+ });
106
+
107
+ const hMinorY = [MH * 0.09, MH * 0.27, MH * 0.45, MH * 0.63, MH * 0.80];
108
+ hMinorY.forEach((y, i) => {
109
+ roads.push(<Road key={`hmin${i}`} top={y} left={0} w={MW} h={7} dark={dark} />);
110
+ });
111
+
112
+ const vMajorX = [MW * 0.15, MW * 0.33, MW * 0.50, MW * 0.68, MW * 0.85];
113
+ vMajorX.forEach((x, i) => {
114
+ roads.push(<Road key={`vm${i}`} top={0} left={x} w={14} h={MH} major dark={dark} />);
115
+ for (let y = 0; y < MH; y += 32) {
116
+ dashes.push(<LaneDash key={`vd${i}-${y}`} top={y} left={x + 6} vertical dark={dark} />);
117
+ }
118
+ });
119
+
120
+ const vMinorX = [MW * 0.07, MW * 0.24, MW * 0.41, MW * 0.59, MW * 0.76, MW * 0.93];
121
+ vMinorX.forEach((x, i) => {
122
+ roads.push(<Road key={`vmin${i}`} top={0} left={x} w={7} h={MH} dark={dark} />);
123
+ });
124
+
125
+ const hAll = [0, ...hMinorY, ...hMajorY, MH].sort((a, b) => a - b);
126
+ const vAll = [0, ...vMinorX, ...vMajorX, MW].sort((a, b) => a - b);
127
+ let shade = 0;
128
+ for (let r = 0; r < hAll.length - 1; r++) {
129
+ for (let c = 0; c < vAll.length - 1; c++) {
130
+ const top = hAll[r] + 8;
131
+ const left = vAll[c] + 8;
132
+ const bh = hAll[r + 1] - hAll[r] - 16;
133
+ const bw = vAll[c + 1] - vAll[c] - 16;
134
+ if (bh > 10 && bw > 10) {
135
+ blocks.push(<Block key={`b${r}-${c}`} top={top} left={left} w={bw} h={bh} shade={shade++} dark={dark} />);
136
+ }
137
+ }
138
+ }
139
+
140
+ return (
141
+ <View style={{ width: MW, height: MH, position: "relative", backgroundColor: dark ? DARK_MAP.base : LIGHT_MAP.base }}>
142
+ <Water top={MH * 0.05} left={MW * 0.55} w={MW * 0.38} h={MH * 0.12} rx={40} dark={dark} />
143
+ <Water top={MH * 0.60} left={-20} w={MW * 0.18} h={MH * 0.08} rx={30} dark={dark} />
144
+ <Water top={MH * 0.82} left={MW * 0.70} w={MW * 0.28} h={MH * 0.10} rx={24} dark={dark} />
145
+ <Park top={MH * 0.20} left={MW * 0.02} w={MW * 0.10} h={MH * 0.10} dark={dark} />
146
+ <Park top={MH * 0.38} left={MW * 0.72} w={MW * 0.12} h={MH * 0.12} dark={dark} />
147
+ <Park top={MH * 0.65} left={MW * 0.35} w={MW * 0.08} h={MH * 0.07} dark={dark} />
148
+ <Park top={MH * 0.80} left={MW * 0.16} w={MW * 0.09} h={MH * 0.06} dark={dark} />
149
+ {blocks}
150
+ {roads}
151
+ {dashes}
152
+ </View>
153
+ );
154
+ };
155
+
156
+ // ─── MOVING TRAFFIC DOT ───
157
+ const TrafficDot = ({ startX, startY, endX, endY, delay, color }: any) => {
158
+ const x = useSharedValue(startX);
159
+ const y = useSharedValue(startY);
160
+
161
+ useEffect(() => {
162
+ x.value = withDelay(delay, withRepeat(
163
+ withTiming(endX, { duration: 3000, easing: Easing.linear }), -1, false
164
+ ));
165
+ y.value = withDelay(delay, withRepeat(
166
+ withTiming(endY, { duration: 3000, easing: Easing.linear }), -1, false
167
+ ));
168
+ }, []);
169
+
170
+ const style = useAnimatedStyle(() => ({
171
+ transform: [{ translateX: x.value }, { translateY: y.value }],
172
+ }));
173
+
174
+ return (
175
+ <Animated.View style={[style, {
176
+ position: "absolute", top: 0, left: 0,
177
+ width: 6, height: 6, borderRadius: 3,
178
+ backgroundColor: color, opacity: 0.75,
179
+ }]} />
180
+ );
181
+ };
182
+
183
+ // ─── PROPERTY PRICE PIN ───
184
+ const PropertyPin = ({ top, left, delay, price, color }: any) => {
185
+ const scale = useSharedValue(0);
186
+ const opacity = useSharedValue(0);
187
+ const bounce = useSharedValue(0);
188
+
189
+ useEffect(() => {
190
+ scale.value = withDelay(delay, withSpring(1, { damping: 8, stiffness: 240 }));
191
+ opacity.value = withDelay(delay, withTiming(1, { duration: 300 }));
192
+ bounce.value = withDelay(delay, withRepeat(
193
+ withSequence(
194
+ withTiming(-4, { duration: 600, easing: Easing.inOut(Easing.quad) }),
195
+ withTiming(0, { duration: 600, easing: Easing.inOut(Easing.quad) })
196
+ ), -1, true
197
+ ));
198
+ }, []);
199
+
200
+ const style = useAnimatedStyle(() => ({
201
+ transform: [{ scale: scale.value }, { translateY: bounce.value }],
202
+ opacity: opacity.value,
203
+ }));
204
+
205
+ return (
206
+ <Animated.View style={[style, { position: "absolute", top, left, alignItems: "center" }]}>
207
+ <View style={{
208
+ backgroundColor: color,
209
+ paddingHorizontal: 9, paddingVertical: 5,
210
+ borderRadius: 14, flexDirection: "row", alignItems: "center", gap: 4,
211
+ shadowColor: color, shadowOffset: { width: 0, height: 4 },
212
+ shadowOpacity: 0.45, shadowRadius: 8, elevation: 6,
213
+ }}>
214
+ <Ionicons name="home" size={11} color="#fff" />
215
+ <Txt style={{ color: "#fff", fontFamily: "InterBold", fontSize: 11 }}>{price}</Txt>
216
+ </View>
217
+ <View style={{
218
+ width: 0, height: 0,
219
+ borderLeftWidth: 5, borderRightWidth: 5, borderTopWidth: 8,
220
+ borderLeftColor: "transparent", borderRightColor: "transparent",
221
+ borderTopColor: color, alignSelf: "center", marginTop: -1,
222
+ }} />
223
+ </Animated.View>
224
+ );
225
+ };
226
+
227
+ // ─── RADAR PULSE ───
228
+ const Pulse = ({ delay, r, primary }: { delay: number; r: number; primary: string }) => {
229
+ const scale = useSharedValue(0.1);
230
+ const opacity = useSharedValue(0.9);
231
+
232
+ useEffect(() => {
233
+ scale.value = withDelay(delay, withRepeat(
234
+ withTiming(1, { duration: 2000, easing: Easing.out(Easing.quad) }), -1, false
235
+ ));
236
+ opacity.value = withDelay(delay, withRepeat(
237
+ withTiming(0, { duration: 2000, easing: Easing.out(Easing.quad) }), -1, false
238
+ ));
239
+ }, []);
240
+
241
+ const s = useAnimatedStyle(() => ({
242
+ transform: [{ scale: scale.value }], opacity: opacity.value,
243
+ }));
244
+
245
+ return (
246
+ <Animated.View style={[s, {
247
+ position: "absolute",
248
+ width: r * 2, height: r * 2, borderRadius: r,
249
+ borderWidth: 2, borderColor: primary,
250
+ backgroundColor: `${primary}10`,
251
+ }]} />
252
+ );
253
+ };
254
+
255
+ // ─── THE BIG PIN (receives visible as plain boolean) ───
256
+ const BigPin = ({ visible, primary }: { visible: boolean; primary: string }) => {
257
+ const dropY = useSharedValue(-120);
258
+ const bounce = useSharedValue(0);
259
+ const shadowScl = useSharedValue(0.3);
260
+ const shadowOp = useSharedValue(0.1);
261
+
262
+ useEffect(() => {
263
+ if (visible) {
264
+ dropY.value = withSpring(0, { damping: 10, stiffness: 120 });
265
+ bounce.value = withDelay(600, withRepeat(
266
+ withSequence(
267
+ withTiming(-10, { duration: 600, easing: Easing.out(Easing.quad) }),
268
+ withTiming(0, { duration: 600, easing: Easing.in(Easing.quad) })
269
+ ), -1, true
270
+ ));
271
+ shadowScl.value = withDelay(600, withRepeat(
272
+ withSequence(withTiming(0.6, { duration: 600 }), withTiming(1, { duration: 600 })), -1, true
273
+ ));
274
+ shadowOp.value = withDelay(600, withRepeat(
275
+ withSequence(withTiming(0.2, { duration: 600 }), withTiming(0.5, { duration: 600 })), -1, true
276
+ ));
277
+ }
278
+ }, [visible]);
279
+
280
+ const pinStyle = useAnimatedStyle(() => ({
281
+ transform: [{ translateY: dropY.value + bounce.value }],
282
+ }));
283
+ const shadowStyle = useAnimatedStyle(() => ({
284
+ transform: [{ scaleX: shadowScl.value }],
285
+ opacity: shadowOp.value,
286
+ }));
287
+
288
+ return (
289
+ <View style={{ alignItems: "center" }}>
290
+ <View style={{ alignItems: "center", justifyContent: "center", marginBottom: -4 }}>
291
+ <Pulse delay={0} r={50} primary={primary} />
292
+ <Pulse delay={700} r={50} primary={primary} />
293
+ <Pulse delay={1400} r={50} primary={primary} />
294
+ </View>
295
+ <Animated.View style={pinStyle}>
296
+ <View style={{
297
+ width: 60, height: 60, borderRadius: 30,
298
+ backgroundColor: primary,
299
+ alignItems: "center", justifyContent: "center",
300
+ borderWidth: 4, borderColor: "#fff",
301
+ shadowColor: primary,
302
+ shadowOffset: { width: 0, height: 10 },
303
+ shadowOpacity: 0.55, shadowRadius: 16, elevation: 14,
304
+ }}>
305
+ <Ionicons name="location" size={30} color="#fff" style={{ marginLeft: 1, marginTop: 2 }} />
306
+ </View>
307
+ <View style={{
308
+ width: 0, height: 0,
309
+ borderLeftWidth: 10, borderRightWidth: 10, borderTopWidth: 16,
310
+ borderLeftColor: "transparent", borderRightColor: "transparent",
311
+ borderTopColor: primary, alignSelf: "center", marginTop: -2,
312
+ }} />
313
+ </Animated.View>
314
+ <Animated.View style={[shadowStyle, {
315
+ width: 36, height: 10, backgroundColor: "#000",
316
+ borderRadius: 8, marginTop: 6,
317
+ }]} />
318
+ </View>
319
+ );
320
+ };
321
+
322
+ // ─── ALTITUDE INDICATOR ───
323
+ const AltitudeBar = ({ primary }: { primary: string }) => {
324
+ const prog = useSharedValue(1);
325
+
326
+ useEffect(() => {
327
+ prog.value = withTiming(0, { duration: 2800, easing: Easing.out(Easing.quad) });
328
+ }, []);
329
+
330
+ const barStyle = useAnimatedStyle(() => ({
331
+ height: `${prog.value * 100}%` as any,
332
+ opacity: interpolate(prog.value, [0, 0.1], [0, 1], Extrapolation.CLAMP),
333
+ }));
334
+
335
+ const altStyle = useAnimatedStyle(() => ({
336
+ opacity: interpolate(prog.value, [0.05, 0.2], [0, 1], Extrapolation.CLAMP),
337
+ }));
338
+
339
+ return (
340
+ <Animated.View style={[altStyle, {
341
+ position: "absolute", right: 20, top: "20%",
342
+ alignItems: "center", gap: 4,
343
+ }]}>
344
+ <Txt style={{ color: "rgba(255,255,255,0.6)", fontSize: 9, fontFamily: "InterMedium", letterSpacing: 1 }}>
345
+ ALT
346
+ </Txt>
347
+ <View style={{
348
+ width: 3, height: 60, borderRadius: 2,
349
+ backgroundColor: "rgba(255,255,255,0.15)", overflow: "hidden",
350
+ justifyContent: "flex-end",
351
+ }}>
352
+ <Animated.View style={[barStyle, { backgroundColor: primary, borderRadius: 2 }]} />
353
+ </View>
354
+ <Txt style={{ color: "rgba(255,255,255,0.6)", fontSize: 9, fontFamily: "InterMedium" }}>
355
+ GND
356
+ </Txt>
357
+ </Animated.View>
358
+ );
359
+ };
360
+
361
+ // ─── COMPASS ───
362
+ const Compass = () => {
363
+ const rotate = useSharedValue(15);
364
+
365
+ useEffect(() => {
366
+ rotate.value = withTiming(-15, { duration: 3000, easing: Easing.out(Easing.quad) });
367
+ }, []);
368
+
369
+ const style = useAnimatedStyle(() => ({
370
+ transform: [{ rotate: `${rotate.value}deg` }],
371
+ }));
372
+
373
+ return (
374
+ <Animated.View style={[style, {
375
+ position: "absolute", left: 20, top: "22%",
376
+ width: 32, height: 32, borderRadius: 16,
377
+ backgroundColor: "rgba(0,0,0,0.35)",
378
+ borderWidth: 1, borderColor: "rgba(255,255,255,0.2)",
379
+ alignItems: "center", justifyContent: "center",
380
+ }]}>
381
+ <Txt style={{ color: "#EF4444", fontSize: 10, fontFamily: "InterBold" }}>N</Txt>
382
+ </Animated.View>
383
+ );
384
+ };
385
+
386
+ // ────────────────────────────
387
+ // MAIN COMPONENT
388
+ // ────────────────────────────
389
+ interface LocationLoaderProps {
390
+ onReady: () => void;
391
+ }
392
+
393
+ export const LocationLoader = ({ onReady }: LocationLoaderProps) => {
394
+ const { colorScheme } = useColorScheme();
395
+ const insets = useSafeAreaInsets();
396
+
397
+ const isDark = colorScheme === "dark";
398
+ const themeColors = Colors[isDark ? "dark" : "light"];
399
+ const primary = themeColors.primary; // #3B82F6 light / #60A5FA dark
400
+ const accent = themeColors.accent; // #14B8A6 / #2DD4BF
401
+ const success = themeColors.success; // #22C55E / #4ADE80
402
+ const warning = themeColors.warning; // #F59E0B / #FBBF24
403
+ const error = themeColors.error; // #EF4444 / #F87171
404
+
405
+ // ── Camera flyover shared values ──
406
+ const camScale = useSharedValue(0.45);
407
+ const camX = useSharedValue(-MW * 0.05);
408
+ const camY = useSharedValue(-MH * 0.08);
409
+
410
+ // ── Pin drops after camera lands — use useState not SharedValue to avoid render warning ──
411
+ const [pinVisible, setPinVisible] = useState(false);
412
+
413
+ // ── Property markers appear during flyover ──
414
+ const markersOpacity = useSharedValue(0);
415
+ const uiOpacity = useSharedValue(0);
416
+ const uiY = useSharedValue(20);
417
+ const screenOpacity = useSharedValue(1);
418
+ const vignetteOpacity = useSharedValue(0);
419
+
420
+ useEffect(() => {
421
+ let active = true;
422
+
423
+ const EXIT_AFTER = 1400;
424
+ const PIN_AT = 600;
425
+ const CAM_DURATION = 1800;
426
+ const MARKER_DELAY = 500;
427
+ const UI_DELAY = 300;
428
+
429
+ // Camera zoom-in flyover
430
+ camScale.value = withTiming(1.15, { duration: CAM_DURATION, easing: Easing.out(Easing.cubic) });
431
+ camX.value = withTiming(-MW * 0.15, { duration: CAM_DURATION, easing: Easing.out(Easing.cubic) });
432
+ camY.value = withTiming(-MH * 0.22, { duration: CAM_DURATION, easing: Easing.out(Easing.cubic) });
433
+
434
+ vignetteOpacity.value = withTiming(1, { duration: CAM_DURATION * 0.6 });
435
+ uiOpacity.value = withDelay(UI_DELAY, withTiming(1, { duration: 500 }));
436
+ uiY.value = withDelay(UI_DELAY, withSpring(0, { damping: 14, stiffness: 80 }));
437
+ markersOpacity.value = withDelay(MARKER_DELAY, withTiming(1, { duration: 500 }));
438
+
439
+ // Drop pin
440
+ const pinTimer = setTimeout(() => { if (active) setPinVisible(true); }, PIN_AT);
441
+
442
+ // Exit
443
+ const exitTimer = setTimeout(() => {
444
+ if (!active) return;
445
+ screenOpacity.value = withTiming(0, { duration: 500 });
446
+ setTimeout(() => { if (active) onReady(); }, 520);
447
+ }, EXIT_AFTER);
448
+
449
+ return () => { active = false; clearTimeout(pinTimer); clearTimeout(exitTimer); };
450
+ }, []);
451
+
452
+ const camStyle = useAnimatedStyle(() => ({
453
+ transform: [
454
+ { translateX: camX.value },
455
+ { translateY: camY.value },
456
+ { scale: camScale.value },
457
+ ],
458
+ }));
459
+ const markersStyle = useAnimatedStyle(() => ({ opacity: markersOpacity.value }));
460
+ const uiStyle = useAnimatedStyle(() => ({ opacity: uiOpacity.value, transform: [{ translateY: uiY.value }] }));
461
+ const screenStyle = useAnimatedStyle(() => ({ opacity: screenOpacity.value }));
462
+ const vigStyle = useAnimatedStyle(() => ({ opacity: vignetteOpacity.value }));
463
+
464
+ // Property markers use brand/semantic colors from theme
465
+ const propMarkers = [
466
+ { top: MH * 0.20, left: MW * 0.05, price: "₹12k", color: success, delay: 1400 },
467
+ { top: MH * 0.26, left: MW * 0.22, price: "₹18k", color: "#8B5CF6", delay: 1700 },
468
+ { top: MH * 0.30, left: MW * 0.45, price: "₹9k", color: warning, delay: 1600 },
469
+ { top: MH * 0.22, left: MW * 0.64, price: "₹24k", color: error, delay: 1900 },
470
+ { top: MH * 0.38, left: MW * 0.10, price: "₹15k", color: accent, delay: 2100 },
471
+ { top: MH * 0.42, left: MW * 0.30, price: "₹11k", color: primary, delay: 2000 },
472
+ { top: MH * 0.36, left: MW * 0.54, price: "₹21k", color: success, delay: 1800 },
473
+ { top: MH * 0.44, left: MW * 0.72, price: "₹8k", color: warning, delay: 2200 },
474
+ ];
475
+
476
+ const traffic = [
477
+ { startX: 0, startY: MH * 0.18 + 3, endX: MW * 0.4, endY: MH * 0.18 + 3, delay: 0, color: warning },
478
+ { startX: MW * 0.4, startY: MH * 0.36 + 3, endX: 0, endY: MH * 0.36 + 3, delay: 400, color: error },
479
+ { startX: 0, startY: MH * 0.54 + 3, endX: MW * 0.5, endY: MH * 0.54 + 3, delay: 800, color: success },
480
+ { startX: MW * 0.15 + 3, startY: 0, endX: MW * 0.15 + 3, endY: MH * 0.5, delay: 200, color: warning },
481
+ { startX: MW * 0.50 + 3, startY: MH * 0.5, endX: MW * 0.50 + 3, endY: 0, delay: 600, color: "#8B5CF6" },
482
+ { startX: MW * 0.33 + 3, startY: 0, endX: MW * 0.33 + 3, endY: MH * 0.6, delay: 300, color: accent },
483
+ ];
484
+
485
+ // Vignette uses theme dark overlay
486
+ const vignDark = isDark ? "rgba(17,24,39," : "rgba(15,23,42,";
487
+
488
+ return (
489
+ <Animated.View style={[StyleSheet.absoluteFill, screenStyle, {
490
+ overflow: "hidden",
491
+ backgroundColor: isDark ? DARK_MAP.base : LIGHT_MAP.base,
492
+ }]}>
493
+
494
+ {/* ── ANIMATED MAP WORLD ── */}
495
+ <Animated.View style={[camStyle, { width: MW, height: MH }]}>
496
+ <MapWorld dark={isDark} />
497
+
498
+ {traffic.map((t, i) => (
499
+ <TrafficDot key={i} {...t} />
500
+ ))}
501
+
502
+ <Animated.View style={[markersStyle, { position: "absolute", top: 0, left: 0, width: MW, height: MH }]}>
503
+ {propMarkers.map((p, i) => (
504
+ <PropertyPin key={i} {...p} />
505
+ ))}
506
+ </Animated.View>
507
+
508
+ {/* Big location pin — uses plain boolean from useState, no .value read in render */}
509
+ <View style={{
510
+ position: "absolute",
511
+ top: MH * 0.31, left: MW * 0.27,
512
+ alignItems: "center",
513
+ }}>
514
+ <BigPin visible={pinVisible} primary={primary} />
515
+ </View>
516
+ </Animated.View>
517
+
518
+ {/* ── VIGNETTE ── */}
519
+ <Animated.View style={[StyleSheet.absoluteFill, vigStyle, { pointerEvents: "none" }]}>
520
+ <LinearGradient
521
+ colors={[`${vignDark}0.88)`, `${vignDark}0.0)`]}
522
+ style={{ position: "absolute", top: 0, left: 0, right: 0, height: height * 0.38 }}
523
+ />
524
+ <LinearGradient
525
+ colors={[`${vignDark}0.0)`, `${vignDark}0.78)`]}
526
+ style={{ position: "absolute", bottom: 0, left: 0, right: 0, height: height * 0.30 }}
527
+ />
528
+ <LinearGradient
529
+ colors={[`${vignDark}0.55)`, `${vignDark}0.0)`]}
530
+ start={{ x: 0, y: 0.5 }} end={{ x: 0.25, y: 0.5 }}
531
+ style={StyleSheet.absoluteFill}
532
+ />
533
+ <LinearGradient
534
+ colors={[`${vignDark}0.0)`, `${vignDark}0.55)`]}
535
+ start={{ x: 0.75, y: 0.5 }} end={{ x: 1, y: 0.5 }}
536
+ style={StyleSheet.absoluteFill}
537
+ />
538
+ </Animated.View>
539
+
540
+ {/* ── HUD ── */}
541
+ <Compass />
542
+ <AltitudeBar primary={primary} />
543
+
544
+ {/* ── BRAND LOGO ── */}
545
+ <Animated.View style={[uiStyle, {
546
+ position: "absolute", top: insets.top + 16,
547
+ left: 0, right: 0, alignItems: "center",
548
+ }]}>
549
+ <View style={{
550
+ flexDirection: "row", alignItems: "center", gap: 10,
551
+ backgroundColor: "rgba(0,0,0,0.40)",
552
+ paddingHorizontal: 20, paddingVertical: 10,
553
+ borderRadius: 28,
554
+ borderWidth: 1, borderColor: "rgba(255,255,255,0.16)",
555
+ }}>
556
+ <View style={{
557
+ width: 32, height: 32, borderRadius: 11,
558
+ backgroundColor: primary,
559
+ alignItems: "center", justifyContent: "center",
560
+ }}>
561
+ <Ionicons name="home" size={17} color="#fff" />
562
+ </View>
563
+ <Txt style={{ color: "#fff", fontFamily: "InterExtraBold", fontSize: 20, letterSpacing: -0.5 }}>
564
+ rentro
565
+ </Txt>
566
+ </View>
567
+ </Animated.View>
568
+
569
+ {/* ── BOTTOM STATUS ── */}
570
+ <Animated.View style={[uiStyle, {
571
+ position: "absolute", bottom: insets.bottom + 40,
572
+ left: 0, right: 0, alignItems: "center",
573
+ }]}>
574
+ <View style={{
575
+ flexDirection: "row", alignItems: "center", gap: 6,
576
+ backgroundColor: "rgba(0,0,0,0.32)",
577
+ paddingHorizontal: 16, paddingVertical: 6,
578
+ borderRadius: 20,
579
+ }}>
580
+ <View style={{ width: 6, height: 6, borderRadius: 3, backgroundColor: success }} />
581
+ <Txt style={{ color: "rgba(255,255,255,0.82)", fontFamily: "InterMedium", fontSize: 12, letterSpacing: 0.3 }}>
582
+ Exploring your neighbourhood
583
+ </Txt>
584
+ </View>
585
+ </Animated.View>
586
+
587
+ </Animated.View>
588
+ );
589
+ };
590
+
591
+ export default LocationLoader;
@@ -0,0 +1,68 @@
1
+ import { View, TouchableOpacity } from "react-native";
2
+ import React from "react";
3
+ import { Ionicons } from "@expo/vector-icons";
4
+ import { Txt } from "./Typography";
5
+ import { useColorScheme } from "nativewind";
6
+ import { Colors } from "../../constants/Colors";
7
+ import { router } from "expo-router";
8
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
9
+
10
+ interface IProps {
11
+ title: string;
12
+ subtitle?: string;
13
+ actions?: React.ReactNode;
14
+ onBack?: () => void;
15
+ }
16
+
17
+ export default function ScreenHeader({
18
+ title,
19
+ subtitle,
20
+ actions,
21
+ onBack,
22
+ }: IProps) {
23
+ const { colorScheme } = useColorScheme();
24
+ const colors = Colors[colorScheme ?? "light"];
25
+ const insets = useSafeAreaInsets();
26
+
27
+ return (
28
+ <View
29
+ className="px-6 flex-row items-center justify-between border-b border-base-200 w-full"
30
+ style={{
31
+ backgroundColor: colors.base200,
32
+ height: insets.top + 56,
33
+ paddingTop: insets.top,
34
+ }}
35
+ >
36
+ <View className="flex-row items-center flex-1 mr-4">
37
+ <TouchableOpacity
38
+ onPress={() => (onBack ? onBack() : router.back())}
39
+ activeOpacity={0.7}
40
+ className="w-10 h-10 rounded-full bg-base-200/80 items-center justify-center mr-3 border border-base-300/10 shadow-sm"
41
+ >
42
+ <Ionicons
43
+ name="arrow-back"
44
+ color={colors.baseContent}
45
+ size={20}
46
+ />
47
+ </TouchableOpacity>
48
+ <View className="flex-1">
49
+ <Txt variant="md" className="text-base-content" numberOfLines={1}>
50
+ {title}
51
+ </Txt>
52
+ {subtitle && (
53
+ <Txt
54
+ variant="xs"
55
+ className="text-base-content/50 mt-0.5"
56
+ numberOfLines={1}
57
+ >
58
+ {subtitle}
59
+ </Txt>
60
+ )}
61
+ </View>
62
+ </View>
63
+ {actions && (
64
+ <View className="flex-row items-center gap-2">{actions}</View>
65
+ )}
66
+ </View>
67
+ );
68
+ }