import { BlurView } from "expo-blur"; import { Platform, StyleSheet, View, type ColorValue } from "react-native"; import { useAppearancePreferences } from "../features/settings/appearance/AppearancePreferencesProvider"; import { themeColorWithAlpha } from "../lib/mobileTheme"; /** Frosted backdrop for containers that clip their children to their shape. */ export function GlassBackdrop(props: { readonly fallbackColor?: ColorValue }) { const { themeAppearance, themeVariables } = useAppearancePreferences(); const supportsBlur = Platform.OS === "ios"; const color = props.fallbackColor ?? themeVariables["--color-glass-fallback"]; const colorStyle = { backgroundColor: supportsBlur || typeof color !== "string" ? color : themeColorWithAlpha(color, 1), }; return ( <> {supportsBlur ? ( ) : null} ); }