55 lines
2.4 KiB
TypeScript
55 lines
2.4 KiB
TypeScript
// Metro module 4588 (f4589).
|
|
import { useMemo } from "react";
|
|
import { Pressable, StyleSheet } from "react-native";
|
|
import { createStyles } from "../../Styles/native/createStyles";
|
|
import Module712 from "../../../../_bundle/Module712";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
import { useThemeContext } from "../../../../_bundle/Module3901";
|
|
import useSafeAreaInsets_native from "../../../../modules/safe_area/useSafeAreaInsets.native";
|
|
import { hexToRgbaString } from "../../../../utils/ColorUtils";
|
|
import ReanimatedRexport from "../../../../modules/reanimated/ReanimatedRexport";
|
|
import VisualEffectViewAnimated from "../../../../modules/visual_effect_view/native/VisualEffectViewAnimated";
|
|
const animatedProps = {};
|
|
const useStyles = createStyles({
|
|
fill: StyleSheet.absoluteFillObject,
|
|
backdrop: {
|
|
backgroundColor: Module712.colors.BACKGROUND_SCRIM
|
|
},
|
|
backdropOpaque: {
|
|
backgroundColor: Module712.colors.MOBILE_BACKGROUND_SCRIM_OPAQUE
|
|
},
|
|
accessibilityDismiss: {
|
|
position: "absolute",
|
|
top: 0,
|
|
left: 0,
|
|
right: 0,
|
|
height: 16
|
|
}
|
|
});
|
|
export function Backdrop(props) {
|
|
const { style, accessibleDismissStyle, animatedProps: animatedProps2 = animatedProps, opaque = false, blur = "none", onDismiss, accessibilityLabel = intl.string(t.WAI6xu) } = props;
|
|
const r11 = props["aria-hidden"];
|
|
const styles = useStyles();
|
|
const theme = useThemeContext().theme;
|
|
const top = useSafeAreaInsets_native().top;
|
|
const backgroundColor = styles.backdrop.backgroundColor;
|
|
const memo = useMemo(() => hexToRgbaString(backgroundColor), [backgroundColor]);
|
|
const r18 = {
|
|
onPress: onDismiss,
|
|
"aria-hidden": true
|
|
};
|
|
return <ReanimatedRexport.View style={[styles.fill, style]} pointerEvents="box-none" animatedProps={animatedProps2}>
|
|
{onDismiss != null && <Pressable style={[styles.accessibilityDismiss, {
|
|
top
|
|
}, accessibleDismissStyle]} onPress={onDismiss} accessibilityRole="button" accessibilityLabel={accessibilityLabel} aria-hidden={r11} />}
|
|
<Pressable {...blur !== "none" ? {
|
|
...r18,
|
|
style: styles.fill,
|
|
children: <VisualEffectViewAnimated blurAmount={blur === "none" ? 0 : blur === "subtle" ? 0.05 : blur !== "strong" ? void 0 : 0.25} style={styles.fill} blurTheme={theme} blurTintRgba={memo} android_fallbackColor={styles.backdrop.backgroundColor} />
|
|
} : {
|
|
...r18,
|
|
style: [styles.fill, opaque ? styles.backdropOpaque : styles.backdrop]
|
|
}} />
|
|
</ReanimatedRexport.View>;
|
|
}
|