* refactor(companion): extract AvailabilityDetailScreen with AppPressable migration Apply Phases 2, 3, 4 to availability-detail.tsx: - Phase 2: Extract screen logic (~995 lines) to components/screens/AvailabilityDetailScreen.tsx - Route file is now a minimal ~35 line wrapper with Stack.Screen config - Phase 3: ScrollView+map pattern kept (7 days is a fixed small list, FlatList not needed) - Phase 4: Migrate all TouchableOpacity to AppPressable (63 instances) Follows the same pattern as EventTypeDetailScreen extraction. * fix(companion): add GlassView header with Save button to AvailabilityDetailScreen (#26107) * refactor(companion): extract BookingDetailScreen with AppPressable migration (#26108) * refactor(companion): extract AvailabilityListScreen with AppPressable migration (#26109) * fix(companion): add GlassView header with Save button to AvailabilityDetailScreen * refactor(companion): extract BookingDetailScreen with AppPressable migration * refactor(companion): extract AvailabilityListScreen with AppPressable migration * refactor(companion): Standardized error handling with dev-only debug logs (#26110) * address cubics comments * address cubics comments * addressed typecheck erros * removed localhost from wxt.config for chrome extension * declare FullScreenModal FullScreenModalProps --------- Co-authored-by: Peer Richelsen <[email protected]> * add loggers for dev env --------- Co-authored-by: Peer Richelsen <[email protected]> --------- Co-authored-by: Peer Richelsen <[email protected]>
20 lines
562 B
TypeScript
20 lines
562 B
TypeScript
import { useEffect } from "react";
|
|
import { useAuth } from "../contexts/AuthContext";
|
|
import { CalComAPIService } from "../services/calcom";
|
|
|
|
export function AuthTokenProvider({ children }: { children: React.ReactNode }) {
|
|
const { accessToken, isAuthenticated, isWebSession } = useAuth();
|
|
|
|
useEffect(() => {
|
|
if (isAuthenticated) {
|
|
if (accessToken) {
|
|
CalComAPIService.setAccessToken(accessToken);
|
|
}
|
|
} else {
|
|
CalComAPIService.clearAuth();
|
|
}
|
|
}, [isAuthenticated, accessToken, isWebSession]);
|
|
|
|
return <>{children}</>;
|
|
}
|