This repository has been archived on 2026-11-17. You can view files and clone it, but cannot push or open issues or pull requests.
caelum0x 46bf9b83bf feat: round-5 external harvest (22 features ported from external/ into 5 products)
Harvest valuable features from external/ reference repos, adapted to each
product's stack and wired in; all products typecheck clean.

- gitgram-web (5): clickable @mention/#hashtag linkify in rendered content
  (munia), + feed/notification/accessibility patterns; install @testing-library/dom
- gitgram-backend (3): feed thread dedup + muted-thread removal (bluesky),
  GitHub star/follow write-back via OAuth (gh-social)
- gitgram-mobile (4): double-tap-to-like + heart bounce (proximity), haptics layer
  (bluesky useHaptics), + gesture/feed UX
- aitm-api (4): beads ready/dependency-DAG endpoints + atomic claim (beads)
- aitm-mcp (6): beads_ready work-queue tool, context-efficient projections,
  transport arg aliasing (context7/pal-mcp/beads)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 18:48:46 +03:00

80 lines
2.7 KiB
TypeScript

import { useEffect } from 'react';
import { Stack } from 'expo-router';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { useAuthStore } from '../store/authStore';
import { useSettingsStore } from '../store/settingsStore';
import { ErrorBoundary } from '../components/common/ErrorBoundary';
import NetworkStatus from '../components/common/NetworkStatus';
import { ToastProvider } from '../components/proximity/Toast';
import { LightboxProvider } from '../components/common/Lightbox';
import { pushNotificationService } from '../services/pushNotificationService';
import { paymentDeepLinkHandler } from '../utils/paymentDeepLinkHandler';
import { setupNotificationDeepLinkHandler, handleNotificationDeepLink } from '../utils/notificationDeepLinkHandler';
import { logger } from '../utils/logger';
export default function RootLayout() {
const { initialize, isAuthenticated } = useAuthStore();
const hydrateSettings = useSettingsStore((state) => state.hydrate);
useEffect(() => {
initialize();
hydrateSettings();
}, []);
useEffect(() => {
if (isAuthenticated) {
// Register for push notifications when user is authenticated
pushNotificationService.registerForPushNotifications();
// Set up notification listeners
const notificationCleanup = pushNotificationService.setupNotificationListeners(
(notification) => {
logger.log('Notification received:', notification);
},
(response) => {
logger.log('Notification tapped:', response);
// Handle deep linking from notification
handleNotificationDeepLink(response);
}
);
// Set up deep link handler for notifications
const deepLinkCleanup = setupNotificationDeepLinkHandler();
return () => {
notificationCleanup();
deepLinkCleanup();
};
}
}, [isAuthenticated]);
useEffect(() => {
// Initialize payment deep link handler
// The handler is already initialized in its constructor
// This effect ensures it stays active during app lifecycle
return () => {
// Cleanup is handled by the singleton instance
};
}, []);
return (
<ErrorBoundary>
<GestureHandlerRootView style={{ flex: 1 }}>
<SafeAreaProvider>
<ToastProvider>
<NetworkStatus />
<Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="(auth)" />
<Stack.Screen name="(tabs)" />
<Stack.Screen name="(modals)" />
</Stack>
<LightboxProvider />
</ToastProvider>
</SafeAreaProvider>
</GestureHandlerRootView>
</ErrorBoundary>
);
}