From 8a999a56a16ac0c3e662bbd303c9876f0b0bfab6 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Wed, 18 Sep 2024 08:41:58 +0200 Subject: [PATCH] chore: component --- components/PlatformBlurView.tsx | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 components/PlatformBlurView.tsx diff --git a/components/PlatformBlurView.tsx b/components/PlatformBlurView.tsx new file mode 100644 index 00000000..77ff0420 --- /dev/null +++ b/components/PlatformBlurView.tsx @@ -0,0 +1,35 @@ +import { BlurView } from "expo-blur"; +import React from "react"; +import { Platform, View, ViewProps } from "react-native"; +interface Props extends ViewProps { + blurAmount?: number; + blurType?: "light" | "dark" | "xlight"; +} + +/** + * BlurView for iOS and simple View for Android + */ +export const PlatformBlurView: React.FC = ({ + blurAmount = 100, + blurType = "light", + style, + children, + ...props +}) => { + if (Platform.OS === "ios") { + return ( + + {children} + + ); + } + + return ( + + {children} + + ); +};