diff options
Diffstat (limited to 'src/view/com/util/BlurView.android.tsx')
-rw-r--r-- | src/view/com/util/BlurView.android.tsx | 30 |
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', + }, +}) |