freshyo/apps/admin-ui/app/_layout.tsx
2026-09-16 21:48:06 +05:30

35 lines
1.3 KiB
TypeScript

import { QueryClientProvider } from "@tanstack/react-query";
import queryClient from "../utils/queryClient";
import { Stack } from "expo-router";
import { LogBox } from "react-native";
import { StaffAuthProvider } from "@/components/context/staff-auth-context";
import { trpc, trpcClient } from "@/src/trpc-client";
import { SafeAreaView } from "react-native-safe-area-context";
import { RefreshProvider } from '../../../packages/ui/src/lib/refresh-context';
// Silence dev warnings/errors in LogBox. The "Open debugger to view warnings"
// toast overlays the bottom of the UI and intercepts taps (e.g. the Add Slot
// FAB), which breaks E2E flows.
if (__DEV__) {
LogBox.ignoreAllLogs(true);
}
export default function Layout() {
return (
<QueryClientProvider client={queryClient}>
<trpc.Provider client={trpcClient} queryClient={queryClient}>
<StaffAuthProvider>
<SafeAreaView
edges={['left', 'right', 'bottom']}
style={{ flex: 1, backgroundColor: '#fff' }}
testID="app-root"
>
<RefreshProvider queryClient={queryClient}>
<Stack screenOptions={{ headerShown: false }} />
</RefreshProvider>
</SafeAreaView>
</StaffAuthProvider>
</trpc.Provider>
</QueryClientProvider>
);
}