about summary refs log tree commit diff
path: root/src/view/com/util/BlurView.android.tsx
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-12-28 15:46:37 -0800
committerGitHub <noreply@github.com>2023-12-28 15:46:37 -0800
commit0d960c58ba7dbd9ac72aa5e8229be6ad91a49b7c (patch)
tree9e2a1d281f8476e69eb616d450c30483306ee723 /src/view/com/util/BlurView.android.tsx
parent705f9b61efebe8ca0d044f1a53586b6fe4614195 (diff)
downloadvoidsky-0d960c58ba7dbd9ac72aa5e8229be6ad91a49b7c.tar.zst
Disable BlurView on android (#2351)
* A couple of small tweaks

* Force the UI to re-render by setting a key

* Disable to blurview on android

* Remove hackfix
Diffstat (limited to 'src/view/com/util/BlurView.android.tsx')
-rw-r--r--src/view/com/util/BlurView.android.tsx30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/view/com/util/BlurView.android.tsx b/src/view/com/util/BlurView.android.tsx
new file mode 100644
index 000000000..eee1d9d86
--- /dev/null
+++ b/src/view/com/util/BlurView.android.tsx
@@ -0,0 +1,30 @@
+import React from 'react'
+import {StyleSheet, View, ViewProps} from 'react-native'
+import {addStyle} from 'lib/styles'
+
+type BlurViewProps = ViewProps & {
+  blurType?: 'dark' | 'light'
+  blurAmount?: number
+}
+
+export const BlurView = ({
+  style,
+  blurType,
+  ...props
+}: React.PropsWithChildren<BlurViewProps>) => {
+  if (blurType === 'dark') {
+    style = addStyle(style, styles.dark)
+  } else {
+    style = addStyle(style, styles.light)
+  }
+  return <View style={style} {...props} />
+}
+
+const styles = StyleSheet.create({
+  dark: {
+    backgroundColor: '#0008',
+  },
+  light: {
+    backgroundColor: '#fff8',
+  },
+})