Skip to content

Mobile Shared Components and UI

Ankit Upadhyay edited this page Jul 24, 2026 · 2 revisions

Mobile: Shared Components and UI

The reusable layer under src/shared/ — primitives, hooks, services, and utilities every feature builds on. Part of Mobile Overview.

src/shared/ structure

components/   ~90 primitives/composites (common/, forms/, tiles/)
hooks/        cross-cutting hooks
services/     apiClient, firebaseNotifications, mobileConfig, posthogAnalytics, uploadService, LocationService, maps/googlePlaces, chatTiming
stores/       locationStore.ts
utils/        dates, currency, geo distance, mime, validation, style helpers
styles/ constants/ screens/common/

Component library (components/common/)

~90 components built on the theme tokens — the reusable "warm-bone" primitive layer:

  • Inputs / controls: Button, PrimaryActionButton, CardActionButton, Input, TouchableInput, Checkbox, OTPInput, SearchBar, PillSelector, FilterPills, RatingStars.
  • Layout / structure: Header, ScreenLayout, SafeArea, Separator, ProfileHeader, BaseCard, DetailsCard, AppointmentCard, DocumentCard.
  • iOS "liquid glass" set: LiquidGlassButton, LiquidGlassCard, LiquidGlassHeader, LiquidGlassIconButton, SwipeableGlassCard, BottomFadeOverlay.
  • Bottom sheets: a large *BottomSheet family (BottomSheet, BottomSheetHeader, ConfirmActionBottomSheet, CountryBottomSheet, CurrencyBottomSheet, BreedBottomSheet, GenderBottomSheet, …).
  • Utility: ErrorBoundary, Loading/GifLoader, Modal, ProfileImagePicker, customSplashScreen.

Forms live in components/forms/ (AddressFields.tsx).

Shared hooks

useAddressAutocomplete, useBottomSheets, useFormScreen, usePermissions, useCurrencyPreference, useLiquidGlassHeaderLayout, and useTheme — the theming entry point. useTheme resolves the active warm-bone theme (light or espresso dark) from the persisted Redux preference (src/features/theme/) plus the OS color scheme (Appearance.addChangeListener), and returns setTheme('light' | 'dark' | 'system'), toggleTheme, and darkModeLocked: false — dark mode shipped with the mobile warm-bone redesign foundation (PR #1792, merged 2026-07-20; epic #1791).

Shared services

apiClient.ts (the central axios client with dev logging, Android 10.0.2.2 normalization, runtime base-URL swap), firebaseNotifications.ts, mobileConfig.ts, deviceTokenRegistry.ts, posthogAnalytics.ts, uploadService.ts, LocationService.ts, maps/googlePlaces.ts, chatTiming.ts.

Theme

src/theme/ — colors.ts, typography.ts, spacing.ts, semanticTokens.ts (mapped to @yosemite-crew/design-tokens, no raw hex in semantic layer), themes.ts (lightTheme/darkTheme), motion.ts, index.ts. Theme state is a Redux slice (src/features/theme/themeSlice.ts). See Design System and Tokens.

Related

Product & Domain
Architecture
Applications
Design & Accessibility
Engineering Handbook
Decisions (ADRs)
Design Docs & Plans
Roadmap
Operations
Meta

Canonical code & docs: main repo · Auto-generated companion: DeepWiki

Clone this wiki locally