Initial commit: code as received (Create/Anything export)
Insole-production time tracker exported from the Create/Anything AI platform. Baseline snapshot before any reverse-engineering or cleanup. - apps/mobile: Expo Router app (iOS/Android/web), the only workspace - publisher/: standalone OpenNext/AWS deploy tooling for the web side - Backend (/api/tasks, /api/logs + DB) lives remotely, not in this repo
This commit is contained in:
38
apps/mobile/polyfills/web/SafeAreaView.web.tsx
Normal file
38
apps/mobile/polyfills/web/SafeAreaView.web.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import React, { forwardRef, type ReactNode } from 'react';
|
||||
import { View } from 'react-native';
|
||||
|
||||
import { SafeAreaView as NativeSafeAreaView } from 'react-native-safe-area-context/lib/commonjs';
|
||||
export {
|
||||
initialWindowMetrics,
|
||||
SafeAreaFrameContext,
|
||||
SafeAreaInsetsContext,
|
||||
SafeAreaProvider,
|
||||
useSafeAreaFrame,
|
||||
} from 'react-native-safe-area-context/lib/commonjs';
|
||||
|
||||
type Edge = 'top' | 'right' | 'bottom' | 'left';
|
||||
type Edges = Edge[] | Record<Edge, 'off' | 'additive' | 'maximum'>;
|
||||
|
||||
interface SafeAreaViewProps {
|
||||
children?: ReactNode;
|
||||
edges?: Edges;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export const SafeAreaView = forwardRef<View, SafeAreaViewProps>(
|
||||
({ children, edges = ['top', 'right', 'bottom', 'left'] as Edges, ...rest }, forwardedRef) => {
|
||||
const isTabletAndAbove = typeof window !== 'undefined' ? window.self !== window.top : true;
|
||||
return (
|
||||
<NativeSafeAreaView {...rest} edges={edges} ref={forwardedRef}>
|
||||
{isTabletAndAbove && (Array.isArray(edges) && (edges as Edge[]).includes('top') || (!Array.isArray(edges) && (edges as Record<Edge, string>).top !== 'off')) && (
|
||||
<View style={{ height: 64 }} />
|
||||
)}
|
||||
{children}
|
||||
{isTabletAndAbove && (Array.isArray(edges) && (edges as Edge[]).includes('bottom') || (!Array.isArray(edges) && (edges as Record<Edge, string>).bottom !== 'off')) && (
|
||||
<View style={{ height: 34 }} />
|
||||
)}
|
||||
</NativeSafeAreaView>
|
||||
);
|
||||
}
|
||||
);
|
||||
export default SafeAreaView;
|
||||
Reference in New Issue
Block a user