diff --git a/src/components/overlay/index.tsx b/src/components/overlay/index.tsx index 737e177b4f..379b107400 100644 --- a/src/components/overlay/index.tsx +++ b/src/components/overlay/index.tsx @@ -4,6 +4,7 @@ import {StyleSheet, Image, ImageProps, ImageSourcePropType} from 'react-native'; import {Colors} from '../../style'; import View from '../view'; import Assets from '../../assets'; +import Constants from '../../commons/Constants'; const OVERLY_TYPES = { VERTICAL: 'vertical', @@ -126,7 +127,7 @@ class Overlay extends PureComponent { const styles = StyleSheet.create({ container: { ...StyleSheet.absoluteFillObject, - width: undefined + width: Constants.isWeb ? '100%' : undefined }, top: { bottom: undefined, diff --git a/webDemo/package.json b/webDemo/package.json index 91ec72069e..3bc2b69540 100644 --- a/webDemo/package.json +++ b/webDemo/package.json @@ -28,7 +28,7 @@ "react-native-shimmer-placeholder": "^2.0.8", "react-native-svg": "15.11.2", "react-native-svg-transformer": "1.5.0", - "react-native-ui-lib": "8.0.0", + "react-native-ui-lib": "8.0.0-snapshot.7447", "react-native-web": "^0.18.6", "typescript": "^4.4.2" }, diff --git a/webDemo/src/App.tsx b/webDemo/src/App.tsx index 05e2bca5f9..6b1e041055 100644 --- a/webDemo/src/App.tsx +++ b/webDemo/src/App.tsx @@ -10,6 +10,7 @@ import Slider from 'react-native-ui-lib/Slider'; import Stepper from 'react-native-ui-lib/Stepper'; import Icon from 'react-native-ui-lib/Icon'; import DateTimePicker from 'react-native-ui-lib/DateTimePicker'; +import UIImage from 'react-native-ui-lib/Image'; // import FloatingButton from 'react-native-ui-lib/FloatingButton' import Chip from 'react-native-ui-lib/Chip'; import Badge from 'react-native-ui-lib/Badge'; @@ -307,6 +308,59 @@ const itemsToRender: ItemToRender[] = [ title: 'Image', FC: Image }, + { + title: 'Image with Overlay', + FC: () => { + const imageSource = { + uri: 'https://images.pexels.com/photos/248412/pexels-photo-248412.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=200' + }; + + return ( + + + Top + + + + Bottom + + + + Vertical + + + + Solid + + + + ); + } + }, { title: 'Progressive Image', FC: ProgressiveImage