Skip to content

Instantly share code, notes, and snippets.

@mdshadman
Created October 21, 2019 13:26
Show Gist options
  • Save mdshadman/1735e773b408f02034e6bc6b54c6bf80 to your computer and use it in GitHub Desktop.
Save mdshadman/1735e773b408f02034e6bc6b54c6bf80 to your computer and use it in GitHub Desktop.
import React from 'react';
import { ScrollView, View, Text } from 'react-native';
import { Thumbnail } from 'native-base';
import styles from '../Styles';
import { TouchableNativeFeedback } from 'react-native-gesture-handler';
class StoriesComponent extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
const { goForStories, storeyJson } = this.props
return (
<View style={styles.swiperView}>
<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
contentContainerStyle={styles.storiesContainer}
>
{storeyJson.map((stories, index) => {
return (
<TouchableNativeFeedback key={index} onPress={goForStories}>
<View style={styles.scrollContent} >
<View style={styles.scrollImageView}>
<Thumbnail source={stories.image} />
</View>
<Text style={styles.scrollTextView} numberOfLines={1}>{stories.name}</Text>
</View>
</TouchableNativeFeedback>
);
})
}
</ScrollView>
</View>
);
}
}
export default StoriesComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment