Skip to content

Commit

Permalink
fix(ui): bottom-sheet background (#1795)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr authored May 6, 2024
1 parent 620470e commit 2fc39b7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/components/GradientView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { memo, ReactElement, ReactNode } from 'react';
import {
ImageBackground,
View,
Image,
ImageSourcePropType,
StyleProp,
StyleSheet,
Expand All @@ -18,14 +19,24 @@ const GradientView = ({
image?: ImageSourcePropType;
children?: ReactNode;
}): ReactElement => (
<ImageBackground style={[styles.root, style]} source={image}>
<View style={[styles.root, style]}>
<Image style={styles.background} source={image} />
{children}
</ImageBackground>
</View>
);

const styles = StyleSheet.create({
root: {
flex: 1,
position: 'relative',
},
background: {
position: 'absolute',
resizeMode: 'stretch',
top: 0,
bottom: 0,
width: '100%',
height: undefined,
},
});

Expand Down

0 comments on commit 2fc39b7

Please sign in to comment.