Created
December 8, 2018 13:14
-
-
Save bogoslavskiy/adb5fc20e43c670706c2c9ade849ce1d 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, | |
StyleSheet, | |
AsyncStorage, | |
View, | |
Text, | |
TouchableOpacity, | |
Image | |
} from 'react-native'; | |
import DialogItem from './Messenger/DialogItem'; | |
import faker from 'faker'; | |
import BotModal from './Messenger/BotModal'; | |
export default class DialogsScreen extends React.Component { | |
static navigationOptions = { | |
title: 'Диалоги', | |
}; | |
render() { | |
let { navigate } = this.props.navigation; | |
return ( | |
<View style={styles.container}> | |
<ScrollView style={styles.dialogsWrapper}> | |
<DialogItem | |
onPress={() => { | |
this.botModal.openModal(); | |
}} | |
peer={{ | |
name: faker.name.findName(), | |
picture: faker.image.avatar(), | |
}} | |
message={{ | |
text: faker.lorem.paragraphs(1), | |
unread: false, | |
date: 1543879638272, | |
}} | |
/> | |
<DialogItem | |
onPress={() => { | |
navigate('Messages'); | |
}} | |
peer={{ | |
name: faker.name.findName(), | |
picture: faker.image.avatar(), | |
}} | |
message={{ | |
text: faker.lorem.paragraphs(1), | |
unread: false, | |
date: 1543873378184, | |
}} | |
/> | |
<DialogItem | |
onPress={() => { | |
navigate('Messages'); | |
}} | |
peer={{ | |
name: faker.name.findName(), | |
picture: faker.image.avatar(), | |
}} | |
message={{ | |
text: faker.lorem.paragraphs(1), | |
unread: false, | |
date: 1543872055586, | |
}} | |
/> | |
<DialogItem | |
onPress={() => { | |
navigate('Messages'); | |
}} | |
peer={{ | |
name: faker.name.findName(), | |
picture: faker.image.avatar(), | |
}} | |
message={{ | |
text: faker.lorem.paragraphs(1), | |
unread: false, | |
date: 1543771303577, | |
}} | |
/> | |
<DialogItem | |
onPress={() => { | |
navigate('Messages'); | |
}} | |
peer={{ | |
name: faker.name.findName(), | |
picture: faker.image.avatar(), | |
}} | |
message={{ | |
text: faker.lorem.paragraphs(1), | |
unread: false, | |
date: 1543768226427, | |
}} | |
/> | |
<DialogItem | |
onPress={() => { | |
navigate('Messages'); | |
}} | |
peer={{ | |
name: faker.name.findName(), | |
picture: faker.image.avatar(), | |
}} | |
message={{ | |
text: faker.lorem.paragraphs(1), | |
unread: true, | |
date: 1543762233155, | |
}} | |
/> | |
<DialogItem | |
onPress={() => { | |
navigate('Messages'); | |
}} | |
peer={{ | |
name: faker.name.findName(), | |
picture: faker.image.avatar(), | |
}} | |
message={{ | |
text: faker.lorem.paragraphs(1), | |
unread: true, | |
date: 1543685239682, | |
}} | |
/> | |
</ScrollView> | |
<BotModal ref={r => this.botModal = r} /> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: '#fff' | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment