Skip to content

Commit 534f1cd

Browse files
committed
Allows the use of static images in pageArray
1 parent e10fc3a commit 534f1cd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

AppIntro.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,11 @@ export default class AppIntro extends Component {
240240
const AnimatedStyle1 = this.getTransform(index, 10, level);
241241
const AnimatedStyle2 = this.getTransform(index, 0, level);
242242
const AnimatedStyle3 = this.getTransform(index, 15, level);
243+
const imgSource = (typeof img === 'string') ? {uri: img} : img;
243244
const pageView = (
244245
<View style={[this.styles.slide, { backgroundColor }]} showsPagination={false} key={index}>
245246
<Animated.View style={[this.styles.header, ...AnimatedStyle1.transform]}>
246-
<Image style={imgStyle} source={{ uri: img }} />
247+
<Image style={imgStyle} source={imgSource} />
247248
</Animated.View>
248249
<View style={this.styles.info}>
249250
<Animated.View style={AnimatedStyle2.transform}>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Example extends Component {
5858
}, {
5959
title: 'Page 2',
6060
description: 'Description 2',
61-
img: 'https://goo.gl/GPO6JB',
61+
img: require('../assets/some_image.png'),
6262
imgStyle: {
6363
height: 93 * 2.5,
6464
width: 103 * 2.5,

0 commit comments

Comments
 (0)