/
ContactCardModal.js
48 lines (42 loc) · 1.18 KB
/
ContactCardModal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import React from 'react'
import { View } from 'react-native'
import {
ContactIdentity,
ContactIdentityActions,
ModalScreen,
} from '@berty/component'
import { withNavigation } from 'react-navigation'
import { Store } from '@berty/container'
const modalWidth = 320
@withNavigation
class ContactCardModal extends React.Component {
static router = ContactIdentity.router
render () {
const { navigation } = this.props
const navigationData = {
id: navigation.getParam('id'),
displayName: navigation.getParam('displayName'),
status: navigation.getParam('status'),
}
return (
<Store.Entity.Contact id={navigationData.id}>
{(data = navigationData) => (
<View
style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}
>
<ModalScreen
showDismiss
width={modalWidth}
footer={
<ContactIdentityActions data={data} modalWidth={modalWidth} />
}
>
<ContactIdentity data={data} />
</ModalScreen>
</View>
)}
</Store.Entity.Contact>
)
}
}
export default ContactCardModal