Last active
October 21, 2019 13:29
-
-
Save mdshadman/37e42bbdb947dabad182db9ece533bb8 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 WhatsappChatListView from './WhatsappchatView'; | |
import localData from '../StoriesData'; | |
import { withNavigation } from 'react-navigation'; | |
import { | |
Container, List, ListItem, Left, Right, | |
Thumbnail, Body, Badge, Text, View | |
} from 'native-base'; | |
import styles from './style'; | |
import Stories from '../Stories'; | |
import { Modal, Dimensions } from 'react-native'; | |
import Carausal from '../Carausal/Carausal'; | |
class WhatsAppChatConatiner extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
modalVisible: false | |
}; | |
} | |
chatUser = localData.whatsAppchatUser; | |
closeModal = () => { | |
this.setState({ modalVisible: false }); | |
} | |
openModal = () => { | |
this.setState({ modalVisible: true }); | |
} | |
render() { | |
const { modalVisible } = this.state | |
return ( | |
<Container> | |
<List | |
dataArray={this.chatUser} | |
renderRow={(user, index) => | |
<ListItem avatar key={index} onPress={this.openModal}> | |
<Left> | |
<Thumbnail source={user.image} /> | |
</Left> | |
<Body style={[styles.bodySection]}> | |
<Text style={styles.userName}>{user.name}</Text> | |
<Text style={styles.userDesc} numberOfLines={1}>{user.description}</Text> | |
</Body> | |
<Right style={[styles.rightSection]}> | |
</Right> | |
</ListItem> | |
} | |
/> | |
<Modal | |
animationType="slide" | |
transparent={false} | |
visible={modalVisible} | |
onRequestClose={() => { | |
Alert.alert('Modal has been closed.'); | |
}}> | |
<View> | |
<Carausal closeModal={this.closeModal} /> | |
</View> | |
</Modal> | |
</Container> | |
); | |
} | |
} | |
export default withNavigation(WhatsAppChatConatiner); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment