UNPKG

react-native-preview-story

Version:

React Native Story Component Which takes Stories array and show exact story view like infamous instagram

31 lines (30 loc) 734 B
"use strict"; import React from 'react'; import { Dimensions, Image } from 'react-native'; import styles from "../Styled.js"; import { jsx as _jsx } from "react/jsx-runtime"; const { width, height } = Dimensions.get('window'); const ContentView = ({ story, imageStyle }) => { switch (story.type) { case 'image': return /*#__PURE__*/_jsx(Image, { source: { uri: story.url, height: imageStyle?.height || height, width: imageStyle?.width || width, scale: imageStyle?.scale || 1 }, style: [styles.backgroundImage, imageStyle] }); default: return story.component; } }; export default ContentView; //# sourceMappingURL=ContentView.js.map