Created
October 21, 2019 13:26
-
-
Save mdshadman/1735e773b408f02034e6bc6b54c6bf80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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