-
Notifications
You must be signed in to change notification settings - Fork 374
/
ContactCardModal.js
54 lines (49 loc) · 1.4 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
49
50
51
52
53
54
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'
import { withStoreContext } from '@berty/store/context'
const modalWidth = 320
@withStoreContext
@withNavigation
class ContactCardModal extends React.Component {
static router = ContactIdentity.router
render() {
const { context, navigation } = this.props
const navigationData = {
id: navigation.getParam('id'),
displayName:
navigation.getParam('displayName') || navigation.getParam('name'),
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}
context={context}
modalWidth={modalWidth}
/>
}
>
<ContactIdentity data={data} context={context} />
</ModalScreen>
</View>
)}
</Store.Entity.Contact>
)
}
}
export default ContactCardModal