Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
ActivityIndicator,
Dimensions,
FlatList,
Text,
View,
} from 'react-native';
import React, { Component } from 'react';
Expand Down Expand Up @@ -51,13 +52,16 @@ export default class Gallery extends Component {
render() {
const backgroundColor = this.props.backgroundColor || '#000';
const data = this.props.data || [];
const noImageMsg = this.props.noImageMsg || 'No images found.';
return (
<View
orientation={this.state.orientation}
style={{ ...styles.container, backgroundColor }}
>
{!data.length &&
<ActivityIndicator style={styles.loader} />}
<View>
<Text>{noImageMsg}</Text>
</View>}

<FlatList
style={styles.swiper}
Expand Down Expand Up @@ -86,6 +90,7 @@ export default class Gallery extends Component {

Gallery.propTypes = {
backgroundColor: PropTypes.string,
noImageMsg: PropTypes.string,
data: PropTypes.arrayOf((propValue, key) => {
if (!propValue[key].id || !propValue[key].image) {
return new Error(
Expand Down
2 changes: 1 addition & 1 deletion src/Slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Slide extends Component {
{ width: Dimensions.get('window').width, height: Dimensions.get('window').height }
]}
>
<ActivityIndicator style={styles.loader} />

{Platform.OS === 'android' ?
<PhotoView
source={this.props.item.image}
Expand Down